Configuration Platform SDK 7.6 API Reference

com.genesyslab.platform.commons.collections
Class Pair

java.lang.Object
  extended bycom.genesyslab.platform.commons.collections.Pair
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
KeyValuePair

public abstract class Pair
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

This class represents the pair in key-value list. You will rarely need to create the Pair explicitly. Use appropriate add method of the list.

See Also:
Serialized Form

Constructor Summary
Pair()
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 byte[] getBinaryValue()
          Return binary value of the Pair or null if the value is not a binary data.
 java.lang.Integer getIntValue()
          Return int value.
 java.lang.String getStringKey()
          Return the key as a String
 java.lang.String getStringValue()
          Return string value of the Pair or null if the value is not a string.
 java.lang.Object getValue()
           
 ValueType getValueType()
          Return the type of value that is stored in this Pair.
 int hashCode()
           
 void setBinaryValue(byte[] data)
          Set value of this Pair to some binary data
 void setIntValue(int i)
          Set value of this Pair to an integer
 void setIntValue(java.lang.Integer i)
          Set value of this Pair to an integer
 void setStringValue(java.lang.String val)
          Set value of this Pair to a String
 void setUTF16Value(java.lang.String val)
          Set value of this Pair to UTF-16 String.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Pair

public Pair()
Method Detail

getStringKey

public java.lang.String getStringKey()
Return the key as a String

Returns:
String value of the key or null if key is not a String

getIntValue

public java.lang.Integer getIntValue()
Return int value.

Returns:
value of this Pair or null if value is not an integer

setIntValue

public void setIntValue(int i)
Set value of this Pair to an integer

Parameters:
i - new value (integer)

setIntValue

public void setIntValue(java.lang.Integer i)
Set value of this Pair to an integer

Parameters:
i - new value (integer)

getBinaryValue

public byte[] getBinaryValue()
Return binary value of the Pair or null if the value is not a binary data.

Returns:
Binary data or null

getValue

public java.lang.Object getValue()

setBinaryValue

public void setBinaryValue(byte[] data)
Set value of this Pair to some binary data

Parameters:
data - new value (binary data)
Throws:
java.lang.NullPointerException - if data is null

getStringValue

public java.lang.String getStringValue()
Return string value of the Pair or null if the value is not a string.

Returns:
String or null

setStringValue

public void setStringValue(java.lang.String val)
Set value of this Pair to a String

Parameters:
val - new value (String)
Throws:
java.lang.NullPointerException - if val is null

setUTF16Value

public void setUTF16Value(java.lang.String val)
Set value of this Pair to UTF-16 String. To retrieve such value use {com.genesyslab.platform.commons.collections.Pair#getStringValue getStringValue() method} The value set with this method will be serialized differently than the value set with setStringValue(String).

Parameters:
val -
Throws:
java.lang.NullPointerException - if val is null

getValueType

public ValueType getValueType()
Return the type of value that is stored in this Pair. For supported types please consult documentation of the List you use.

Returns:
Type of the value for this Pair.

equals

public boolean equals(java.lang.Object obj)

hashCode

public int hashCode()

toString

public java.lang.String toString()

Configuration Platform SDK 7.6 API Reference

Send comments on this topic.
Copyright © 2006–2008 Genesys Telecommunication Laboratories, Inc. All rights reserved.