/**
 * Copyright (c) 2010-2015, openHAB.org and others.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 */
package org.openhab.binding.zwave.internal.protocol;

import com.thoughtworks.xstream.annotations.XStreamAlias;

/**
 * This class provides a storage class for zwave configuration parameters
 * within the configuration command class. This is then serialized to XML.
 * @author Chris Jackson
 * @since 1.4.0
 *
 */
@XStreamAlias("configurationParameter")
public class ConfigurationParameter {

	private final int index;
	private final int size;
	private int value;
	private boolean readOnly;
	private boolean writeOnly;
	
	/***
	 * Constructor. Creates a new instance of the {@link ConfigurationParameter} class.
	 * @param index. The parameter index.
	 * @param value. The parameter value;
	 * @throws IllegalArgumentException thrown when the index or size arguments are out of range.
	 */
	public ConfigurationParameter(int index, int value, int size) throws IllegalArgumentException {
		
		if (size != 1 && size != 2 && size != 4) {
			throw new IllegalArgumentException("illegal parameter size");
		}
		
		if (index < 0 || index > 0xFF) {
			throw new IllegalArgumentException("illegal parameter index");
		}
		
		this.index = index;
		this.size = size;
		this.setValue(value);
	}
	
	/**
	 * Gets the configuration parameter value
	 * @return the value
	 */
	public int getValue() {
		return value;
	}

	/**
	 * Sets the configuration parameter value.
	 * @param value the value to set
	 */
	public void setValue(int value) throws IllegalArgumentException {
		this.value = value;
	}

	/**
	 * Returns the parameter index.
	 * @return the index
	 */
	public int getIndex() {
		return index;
	}

	/**
	 * Returns the parameter size.
	 * @return the size
	 */
	public int getSize() {
		return size;
	}
	
	/**
	 * Sets the parameter as a WriteOnly parameter
	 * @param write true if the parameter should not be read
	 */
	public void setWriteOnly(boolean write) {
		writeOnly = write;
	}

	/**
	 * Returns true if this parameter is write only
	 * @return true if the parameter should not be read back
	 */
	public boolean getWriteOnly() {
		return writeOnly;
	}

	/**
	 * Sets the parameter as a ReadOnly parameter
	 * @param read true if the parameters is readonly
	 */
	public void setReadOnly(boolean read) {
		readOnly = read;
	}

	/**
	 * Returns true if this parameter is read only
	 * @return true if the parameter should not be written to
	 */
	public boolean getReadOnly() {
		return readOnly;
	}
}

@@ -710,19 +710,23 @@
 e final 
-i
+I
 nt
+eger
  index;%0A
@@ -740,19 +740,23 @@
 e final 
-i
+I
 nt
+eger
  size;%0A%09
@@ -763,19 +763,23 @@
 private 
-i
+I
 nt
+eger
  value;%0A
@@ -1139,19 +1139,23 @@
 ter(
-i
+I
 nt
+eger
  index, 
 int 
@@ -1154,19 +1154,23 @@
 ex, 
-i
+I
 nt
+eger
  value, 
 int 
@@ -1165,19 +1165,23 @@
  value, 
-i
+I
 nt
+eger
  size) t
@@ -1591,27 +1591,31 @@
  */%0A%09public 
-i
+I
 nt
+eger
  getValue() 
@@ -1746,19 +1746,23 @@
 etValue(
-i
+I
 nt
+eger
  value) 
@@ -1890,27 +1890,31 @@
  */%0A%09public 
-i
+I
 nt
+eger
  getIndex() 
@@ -2006,19 +2006,23 @@
 %09public 
-i
+I
 nt
+eger
  getSize

Update arguments to use Integer https://github.com/openhab/openhab/pull/2500