|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.plumtree.remote.util.NamedValueMap
Utility class that converts between an array of NamedValues and a
HashMap. Useful when manipulating arrays of NamedValues.
| Constructor Summary | |
NamedValueMap()
Default constructor |
|
NamedValueMap(NamedValue[] nvArray)
Creates a new NamedValueMap instance and initializes it
with values from the given array. |
|
| Method Summary | |
void |
fromArray(NamedValue[] nvArray)
Clears the current values and initializes with values from the given array. |
java.lang.String |
get(java.lang.String key)
Returns the string value to which the specified name key is mapped or null if the key is not mapped to any values. |
java.lang.String |
put(java.lang.String key,
java.lang.String value)
Adds a name/value pair to the map, replacing any existing value. |
java.lang.String |
put(java.lang.String key,
java.lang.String[] values)
Adds multiple name/value pairs to the map, where the value is a String[], replacing any existing values. |
void |
remove(java.lang.String key)
Removes the mapping for the key from the map if present. |
void |
remove(java.lang.String key,
java.lang.String value)
Removes the mapping for the key and value from the map if present. |
NamedValue[] |
toArray()
Converts the contents of the NamedValueMap into a NamedValue
array, and returns the array. |
java.lang.String |
toString()
Returns a string for debugging. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public NamedValueMap()
public NamedValueMap(NamedValue[] nvArray)
NamedValueMap instance and initializes it
with values from the given array. Null NamedValues and NamedValues with
null keys will not be added to the map. NamedValues with null values but
valid keys will be imported
nvArray - NamedValue array| Method Detail |
public java.lang.String get(java.lang.String key)
key - the key for which a string will be returned
public java.lang.String put(java.lang.String key,
java.lang.String value)
key - key name. Note that all names will be uppercased by the portal.value - value to assign to the key. Can be null.
public java.lang.String put(java.lang.String key,
java.lang.String[] values)
key - key name. Note that all names will be uppercased by the portal.values - values to assign to the key. Can be null.
public void fromArray(NamedValue[] nvArray)
nvArray - NamedValue arraypublic NamedValue[] toArray()
NamedValue
array, and returns the array.
Keys with String[] mappings will be returned as multiple NamedValues.
NamedValue arraypublic void remove(java.lang.String key)
key - key to match
public void remove(java.lang.String key,
java.lang.String value)
key - key to matchpublic java.lang.String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright ©2007 BEA Systems, Inc. All Rights Reserved.