|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MultivaluedMap
A map of key-values pairs. Each key can have zero or more values.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry<K,V> |
Method Summary | ||
---|---|---|
void |
add(java.lang.String key,
java.lang.Object value)
Add a value to the current list of values for the supplied key. |
|
|
get(java.lang.String key,
java.lang.Class<A> type)
Get the list of values for a particular key. |
|
java.lang.String |
getFirst(java.lang.String key)
A shortcut to get the first value of the supplied key. |
|
|
getFirst(java.lang.String key,
A defaultValue)
A shortcut to get the first value of the supplied key. |
|
|
getFirst(java.lang.String key,
java.lang.Class<A> type)
A shortcut to get the first value of the supplied key. |
|
void |
putSingle(java.lang.String key,
java.lang.Object value)
Set a value to be the single value in the current list of values for the supplied key. |
Methods inherited from interface java.util.Map |
---|
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
Method Detail |
---|
<A> java.util.List<A> get(java.lang.String key, java.lang.Class<A> type)
key
- the keytype
- the desired class of the member of the returned list. The
class must have a constructor
that accepts a single String argument.
void putSingle(java.lang.String key, java.lang.Object value)
key
- the keyvalue
- the value to be putSingle, the object's toString
method will be called to obtain a String value.Object.toString()
void add(java.lang.String key, java.lang.Object value)
key
- the keyvalue
- the value to be added, the object's toString
method will be called to obtain a String value.Object.toString()
java.lang.String getFirst(java.lang.String key)
key
- the key
<A> A getFirst(java.lang.String key, java.lang.Class<A> type)
key
- the keytype
- the desired class of the returned value. The
class must have a constructor
that accepts a single String argument.
<A> A getFirst(java.lang.String key, A defaultValue)
key
- the keydefaultValue
- the default value that is the desired class of
the returned value.
The class must have a constructor
that accepts a single String argument.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |