Package com.adobe.granite.rest.utils
Class ModifiableMappedValueMapDecorator
- java.lang.Object
-
- org.apache.sling.api.wrappers.ValueMapDecorator
-
- org.apache.sling.api.wrappers.ModifiableValueMapDecorator
-
- com.adobe.granite.rest.utils.ModifiableMappedValueMapDecorator
-
- All Implemented Interfaces:
java.util.Map<java.lang.String,java.lang.Object>
,ModifiableValueMap
,ValueMap
public class ModifiableMappedValueMapDecorator extends ModifiableValueMapDecorator
A value map wrapper which implements mapping of certain property names.By default the following properties are mapped.
- jcr:title to dc:title
- jcr:description to dc:description
- jcr:language to dc:language
-
-
Constructor Summary
Constructors Constructor Description ModifiableMappedValueMapDecorator(java.util.Map<java.lang.String,java.lang.Object> base)
Creates a new wrapper around a given map.ModifiableMappedValueMapDecorator(ValueMap base)
Creates a new wrapper around a given map.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsKey(java.lang.Object key)
java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>>
entrySet()
java.lang.Object
get(java.lang.Object key)
java.util.Set<java.lang.String>
keySet()
static java.lang.String
mapProperty(java.lang.String unmappedName)
Returns the unmapped property name for the providedunmappedName
.java.lang.Object
put(java.lang.String key, java.lang.Object value)
void
putAll(java.util.Map<? extends java.lang.String,?> t)
static java.lang.String
unmapProperty(java.lang.String mappedName)
Returns the unmapped property name for the providedmappedName
.-
Methods inherited from class org.apache.sling.api.wrappers.ValueMapDecorator
clear, containsValue, equals, get, get, hashCode, isEmpty, remove, size, toString, values
-
-
-
-
Constructor Detail
-
ModifiableMappedValueMapDecorator
public ModifiableMappedValueMapDecorator(java.util.Map<java.lang.String,java.lang.Object> base)
Creates a new wrapper around a given map.- Parameters:
base
- Wrapped object
-
ModifiableMappedValueMapDecorator
public ModifiableMappedValueMapDecorator(ValueMap base)
Creates a new wrapper around a given map.- Parameters:
base
- Wrapped object
-
-
Method Detail
-
get
public java.lang.Object get(java.lang.Object key)
- Specified by:
get
in interfacejava.util.Map<java.lang.String,java.lang.Object>
- Overrides:
get
in classValueMapDecorator
-
put
public java.lang.Object put(java.lang.String key, java.lang.Object value)
- Specified by:
put
in interfacejava.util.Map<java.lang.String,java.lang.Object>
- Overrides:
put
in classValueMapDecorator
-
putAll
public void putAll(java.util.Map<? extends java.lang.String,?> t)
- Specified by:
putAll
in interfacejava.util.Map<java.lang.String,java.lang.Object>
- Overrides:
putAll
in classValueMapDecorator
-
containsKey
public boolean containsKey(java.lang.Object key)
- Specified by:
containsKey
in interfacejava.util.Map<java.lang.String,java.lang.Object>
- Overrides:
containsKey
in classValueMapDecorator
-
keySet
public java.util.Set<java.lang.String> keySet()
- Specified by:
keySet
in interfacejava.util.Map<java.lang.String,java.lang.Object>
- Overrides:
keySet
in classValueMapDecorator
-
entrySet
public java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> entrySet()
- Specified by:
entrySet
in interfacejava.util.Map<java.lang.String,java.lang.Object>
- Overrides:
entrySet
in classValueMapDecorator
-
mapProperty
public static java.lang.String mapProperty(java.lang.String unmappedName)
Returns the unmapped property name for the providedunmappedName
. The implementation of this method maps the propertiesjcr:title,jcr:description,jcr:language
todc:title,dc:description,dc:language
.- Parameters:
unmappedName
- Unmapped property name- Returns:
- Mapped property name
-
unmapProperty
public static java.lang.String unmapProperty(java.lang.String mappedName)
Returns the unmapped property name for the providedmappedName
. The implementation of this method maps the propertiesdc:title,dc:description,dc:language
tojcr:title,jcr:description,jcr:language
.- Parameters:
mappedName
- Mapped property name- Returns:
- Unmapped property name
-
-