T
- type of the valuepublic class RestApiMultivaluedMapWrapper<T> extends Object implements Map<String,T>
MultivaluedMap
so that by default the first entry will be returned at get.
However the wrapper can be configured to join parameters by "," if the parameters name is defined
in commaSeparatedParameters
(as passed to the constructor).
For example if the values "f_userIds" is set in the commaSeparatedParameters
list then
get() will join all values of the multivalued map. If the multivalued map contains two value
"1,2" and "45" then the result will be "1,2,45"Constructor and Description |
---|
RestApiMultivaluedMapWrapper(javax.ws.rs.core.MultivaluedMap<String,String> multivaluedMap) |
RestApiMultivaluedMapWrapper(javax.ws.rs.core.MultivaluedMap<String,String> multivaluedMap,
Collection<String> commaSeparatedParameters) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Calls multivaluedMap.clear()
|
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<String,T>> |
entrySet()
Not supported.
|
T |
get(Object key)
If the wrapped multivalued map contains several values and the key is defined in
commaSeparatedParameters (as passed to the constructor) then all values are joined
by "," |
boolean |
isEmpty() |
Set<String> |
keySet() |
String |
put(String key,
String value)
Calls multivaluedMap.putSingle(key, value)
|
T |
put(String key,
T value)
Calls multivaluedMap.putSingle(key, value)
type of the value
|
void |
putAll(Map<? extends String,? extends T> m)
Calls multivaluedMap.putSingle(key, value)
type of the value
|
T |
remove(Object key) |
int |
size() |
Collection<T> |
values() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
public RestApiMultivaluedMapWrapper(javax.ws.rs.core.MultivaluedMap<String,String> multivaluedMap)
multivaluedMap
- The map to wrap.public RestApiMultivaluedMapWrapper(javax.ws.rs.core.MultivaluedMap<String,String> multivaluedMap, Collection<String> commaSeparatedParameters)
multivaluedMap
- The map to wrap.commaSeparatedParameters
- commaSeparatedParameters
(as passed to the constructor) then all values
are joined by ","public void clear()
public boolean containsKey(Object key)
containsKey
in interface Map<String,T>
public boolean containsValue(Object value)
containsValue
in interface Map<String,T>
public Set<Map.Entry<String,T>> entrySet()
UnsupportedOperationException
.public T get(Object key)
commaSeparatedParameters
(as passed to the constructor) then all values are joined
by ","public boolean isEmpty()
public String put(String key, String value)
key
- The key.value
- The valuepublic void putAll(Map<? extends String,? extends T> m)
Copyright © 2019 Communote team. All rights reserved.