public class MergedValueMap extends java.lang.Object implements ValueMap
It is optimized for the forms module, ie. on calls to
get(String, Class)
with String[]
as type (see
FormsHelper.getValues(org.apache.sling.api.SlingHttpServletRequest, Resource)
).
Note: this class is not synchronized, ie. not thread-safe.
Constructor and Description |
---|
MergedValueMap(java.util.List<Resource> resources) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> |
entrySet() |
java.lang.Object |
get(java.lang.Object key) |
<T> T |
get(java.lang.String name,
java.lang.Class<T> type)
Get a named property and convert it into the given type.
|
<T> T |
get(java.lang.String name,
T defaultValue)
Get a named property and convert it into the given type.
|
boolean |
isEmpty() |
java.util.Set<java.lang.String> |
keySet() |
java.lang.Object |
put(java.lang.String key,
java.lang.Object value) |
void |
putAll(java.util.Map<? extends java.lang.String,? extends java.lang.Object> t) |
java.lang.Object |
remove(java.lang.Object key) |
int |
size() |
java.util.Collection<java.lang.Object> |
values() |
public MergedValueMap(java.util.List<Resource> resources)
public java.lang.Object get(java.lang.Object key)
get
in interface java.util.Map<java.lang.String,java.lang.Object>
public <T> T get(java.lang.String name, java.lang.Class<T> type)
ValueMap
null
in this
case.public <T> T get(java.lang.String name, T defaultValue)
ValueMap
null
.
Therefore all implementations should internally call Map.get(Object)
when the 2nd parameter
has value null
.get
in interface ValueMap
T
- The expected typename
- The name of the propertydefaultValue
- The default value to use if the named property does
not exist or cannot be converted to the requested type. The
default value is also used to define the type to convert the
value to. Must not be null
. If you want to return null
by default
rather rely on ValueMap.get(String, Class)
.public int size()
size
in interface java.util.Map<java.lang.String,java.lang.Object>
public boolean isEmpty()
isEmpty
in interface java.util.Map<java.lang.String,java.lang.Object>
public boolean containsKey(java.lang.Object key)
containsKey
in interface java.util.Map<java.lang.String,java.lang.Object>
public boolean containsValue(java.lang.Object value)
containsValue
in interface java.util.Map<java.lang.String,java.lang.Object>
public java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> entrySet()
entrySet
in interface java.util.Map<java.lang.String,java.lang.Object>
public java.util.Set<java.lang.String> keySet()
keySet
in interface java.util.Map<java.lang.String,java.lang.Object>
public java.util.Collection<java.lang.Object> values()
values
in interface java.util.Map<java.lang.String,java.lang.Object>
public void clear()
clear
in interface java.util.Map<java.lang.String,java.lang.Object>
public java.lang.Object put(java.lang.String key, java.lang.Object value)
put
in interface java.util.Map<java.lang.String,java.lang.Object>
public void putAll(java.util.Map<? extends java.lang.String,? extends java.lang.Object> t)
putAll
in interface java.util.Map<java.lang.String,java.lang.Object>
public java.lang.Object remove(java.lang.Object key)
remove
in interface java.util.Map<java.lang.String,java.lang.Object>
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"