com.cisco.provisioning.cpe.extensions.configuration
Class CNROptionArgumentArray

java.lang.Object
  extended by com.cisco.provisioning.cpe.extensions.configuration.CNROptionArgumentArray
All Implemented Interfaces:
com.cisco.csrc.encode.Encodable

public final class CNROptionArgumentArray
extends Object
implements com.cisco.csrc.encode.Encodable

This class encapsulates the argument array (DEX_ARG_ARRAY) used in the DEXv2 API exposed by the CNR extension points. It is to be used in DHCPCmds to identify the exact option to operate on.


Constructor Summary
CNROptionArgumentArray()
          No-arg constructor required by Encodable
CNROptionArgumentArray(Object... objects)
           Constructs a new CNROptionArgumentArray from the variable arguments.
 
Method Summary
 void decode(ByteArrayInputStream in, com.cisco.csrc.encode.DataDecoder decoder)
          Decodes object's data and sets object's variables.
 void encode(ByteArrayOutputStream out, com.cisco.csrc.encode.DataEncoder encoder)
          Encodes object's data.
 boolean equals(Object object)
          Indicates whether some other object is "equal to" this one.
 int hashCode()
          Returns the hash code for this object.
 String toString()
          Return a string containing the contents of this object in human-readable form.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CNROptionArgumentArray

public CNROptionArgumentArray()
No-arg constructor required by Encodable


CNROptionArgumentArray

public CNROptionArgumentArray(Object... objects)

Constructs a new CNROptionArgumentArray from the variable arguments. The format for the arguments must be a CNROptionArgumentType followed by an appropriate value.

For example:

 
     ...
     final CNROptionArgumentArray arg = new CNROptionArgumentArray(
         CNROptionArgumentType.OPTION_NUMBER, 82,
         CNROptionArgumentType.SUBOPTION_NAME, "9",
         CNROptionArgumentType.ENTERPRISE_ID, 4491,
         CNROptionArgumentType.SUBOPTION_NUMBER, 1,
         CNROptionArgumentType.SUBOPTION_NUMBER, 1,
         CNROptionArgumentType.END);
     ...
     
 

Parameters:
objects - - the variable arguments in the appropriate format.
Method Detail

hashCode

public int hashCode()
Returns the hash code for this object.

Overrides:
hashCode in class Object
Returns:
the hash code for this object.

equals

public boolean equals(Object object)
Indicates whether some other object is "equal to" this one.

Overrides:
equals in class Object
Parameters:
object - the object to compare
Returns:
true if equal, otherwise return false.

toString

public String toString()
Return a string containing the contents of this object in human-readable form.

Overrides:
toString in class Object
Returns:
the string representation of this object.

encode

public void encode(ByteArrayOutputStream out,
                   com.cisco.csrc.encode.DataEncoder encoder)
Encodes object's data.

Specified by:
encode in interface com.cisco.csrc.encode.Encodable
Parameters:
out - the output stream to write to
encoder - the encoder to use

decode

public void decode(ByteArrayInputStream in,
                   com.cisco.csrc.encode.DataDecoder decoder)
Decodes object's data and sets object's variables.

Specified by:
decode in interface com.cisco.csrc.encode.Encodable
Parameters:
in - the input stream to write to
decoder - the decoder to use