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:
Map<String,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(Map<String,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 booleancontainsKey(Object key)Set<Map.Entry<String,Object>>entrySet()Objectget(Object key)Set<String>keySet()static StringmapProperty(String unmappedName)Returns the unmapped property name for the providedunmappedName.Objectput(String key, Object value)voidputAll(Map<? extends String,?> t)static StringunmapProperty(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
-
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsValue, equals, forEach, getOrDefault, hashCode, isEmpty, merge, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
-
-
Constructor Detail
-
ModifiableMappedValueMapDecorator
public ModifiableMappedValueMapDecorator(Map<String,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
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKeyin interfaceMap<String,Object>- Overrides:
containsKeyin classValueMapDecorator
-
mapProperty
public static String mapProperty(String unmappedName)
Returns the unmapped property name for the providedunmappedName. The implementation of this method maps the propertiesjcr:title,jcr:description,jcr:languagetodc:title,dc:description,dc:language.- Parameters:
unmappedName- Unmapped property name- Returns:
- Mapped property name
-
unmapProperty
public static String unmapProperty(String mappedName)
Returns the unmapped property name for the providedmappedName. The implementation of this method maps the propertiesdc:title,dc:description,dc:languagetojcr:title,jcr:description,jcr:language.- Parameters:
mappedName- Mapped property name- Returns:
- Unmapped property name
-
-