Configuration Platform SDK 7.6 API Reference

com.genesyslab.platform.commons.collections
Class KeyValueCollection

java.lang.Object
  extended bycom.genesyslab.platform.commons.collections.KVList
      extended bycom.genesyslab.platform.commons.collections.KeyValueCollection
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.io.Serializable

public class KeyValueCollection
extends KVList

A key-value list created from an ordered collection of key-value pairs. Nulls are not accepted either as a key or as a value.

Keys are not required to be unique and getters will return the first encountered value for the key. Use getEnumeration(String) if you need all pairs with the given key.

This list supports String keys only. Values can be:

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class com.genesyslab.platform.commons.collections.KVList
KVList.PairList
 
Constructor Summary
KeyValueCollection()
          Create new empty list.
 
Method Summary
 void addList(java.lang.String key, KeyValueCollection list)
          Add TKV list to this list under specified key.
 void addObject(java.lang.String key, java.lang.Object value)
          Add supported value to this list with specified key.
 void addPair(KeyValuePair pair)
          Add TKV pair to the list.
 KeyValueCollection getList(java.lang.String key)
          Return list value stored with specified key.
 KeyValuePair getPair(java.lang.String key)
          Return TKV pair stored with specified key.
 KeyValuePair remove(java.lang.String key)
          Removes the pair with the specified String key from this list.
 java.lang.String toString()
           
 java.lang.String toStringLine()
           
 
Methods inherited from class com.genesyslab.platform.commons.collections.KVList
add, addAll, addBinary, addInt, addInt, addString, addUTFString, clear, clone, contains, containsAll, containsKey, equals, getBinary, getEnumeration, getEnumeration, getInt, getString, isEmpty, iterator, length, remove, removeAll, retainAll, size, toArray, toArray
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
hashCode
 

Constructor Detail

KeyValueCollection

public KeyValueCollection()
Create new empty list.

Method Detail

addPair

public void addPair(KeyValuePair pair)
Add TKV pair to the list.

Parameters:
pair - TKV value

getPair

public KeyValuePair getPair(java.lang.String key)
Return TKV pair stored with specified key. If no such key in list null is returned.

Parameters:
key - key of the pair
Returns:
pair or null if key not found

remove

public KeyValuePair remove(java.lang.String key)
Removes the pair with the specified String key from this list. Returns the pair that was removed from the list.

Parameters:
key - the key of the pair to be removed
Returns:
the element that was removed

addList

public void addList(java.lang.String key,
                    KeyValueCollection list)
Add TKV list to this list under specified key.

Parameters:
key - the key of the list to be added
list - the list to add

getList

public KeyValueCollection getList(java.lang.String key)
Return list value stored with specified key. If no such key in list or data is not TKVList (has some other type) null is returned.

Parameters:
key - the key of the value
Returns:
value or null if key not found or value has some other type

addObject

public void addObject(java.lang.String key,
                      java.lang.Object value)
               throws java.lang.IllegalArgumentException
Description copied from class: KVList
Add supported value to this list with specified key. Please note, that list does not support arbitrary values, there is limited amount of supported types. This method will throw exception if value is of unsupported type. Also, string values will be added as ordinary (one byte per simbol) string. If you need to use national symbols use KVList.addUTFString(String, String).

Overrides:
addObject in class KVList
Parameters:
key - key of the added pair
value - value
Throws:
java.lang.IllegalArgumentException - if value has unsupported type

toString

public java.lang.String toString()
Overrides:
toString in class KVList

toStringLine

public java.lang.String toStringLine()

Configuration Platform SDK 7.6 API Reference

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