Package org.alfresco.util
Class PropertyMap
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<org.alfresco.service.namespace.QName,Serializable>
-
- org.alfresco.util.PropertyMap
-
- All Implemented Interfaces:
Serializable,Cloneable,Map<org.alfresco.service.namespace.QName,Serializable>
public class PropertyMap extends HashMap<org.alfresco.service.namespace.QName,Serializable>
Property map helper class.This class can be used as a short hand when a class of type Map<QName, Serializable> is required.
- Author:
- Roy Wetherall
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Field Summary
Fields Modifier and Type Field Description static Map<org.alfresco.service.namespace.QName,Serializable>EMPTY_MAPA static empty map to us when having to deal with nulls
-
Constructor Summary
Constructors Constructor Description PropertyMap()PropertyMap(int initialCapacity)PropertyMap(int initialCapacity, float loadFactor)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Map<org.alfresco.service.namespace.QName,Serializable>getAddedProperties(Map<org.alfresco.service.namespace.QName,Serializable> before, Map<org.alfresco.service.namespace.QName,Serializable> after)Utility method to get properties which were added as part of a change.static org.alfresco.util.Pair<Map<org.alfresco.service.namespace.QName,Serializable>,Map<org.alfresco.service.namespace.QName,Serializable>>getBeforeAndAfterMapsForChanges(Map<org.alfresco.service.namespace.QName,Serializable> before, Map<org.alfresco.service.namespace.QName,Serializable> after)Utility method to remove unchanged entries from each map.static Map<org.alfresco.service.namespace.QName,Serializable>getChangedProperties(Map<org.alfresco.service.namespace.QName,Serializable> before, Map<org.alfresco.service.namespace.QName,Serializable> after)Utility method to get properties which were changed (but not added or removed) as part of a change.static Map<org.alfresco.service.namespace.QName,Serializable>getRemovedProperties(Map<org.alfresco.service.namespace.QName,Serializable> before, Map<org.alfresco.service.namespace.QName,Serializable> after)Utility method to get properties which were removed as part of a change.static Map<org.alfresco.service.namespace.QName,Serializable>getUnchangedProperties(Map<org.alfresco.service.namespace.QName,Serializable> before, Map<org.alfresco.service.namespace.QName,Serializable> after)Utility method to get properties which were unchanged as part of a change.-
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
-
-
-
Field Detail
-
EMPTY_MAP
public static final Map<org.alfresco.service.namespace.QName,Serializable> EMPTY_MAP
A static empty map to us when having to deal with nulls
-
-
Constructor Detail
-
PropertyMap
public PropertyMap(int initialCapacity, float loadFactor)- See Also:
HashMap(int, float)
-
PropertyMap
public PropertyMap(int initialCapacity)
- See Also:
HashMap(int)
-
PropertyMap
public PropertyMap()
- See Also:
HashMap()
-
-
Method Detail
-
getBeforeAndAfterMapsForChanges
public static org.alfresco.util.Pair<Map<org.alfresco.service.namespace.QName,Serializable>,Map<org.alfresco.service.namespace.QName,Serializable>> getBeforeAndAfterMapsForChanges(Map<org.alfresco.service.namespace.QName,Serializable> before, Map<org.alfresco.service.namespace.QName,Serializable> after)
Utility method to remove unchanged entries from each map.- Parameters:
before- the properties before (may be null)after- the properties after (may be null)- Returns:
- Return a map of values that changed from before to after. The before value is first and the after value is second.
- Since:
- 3.2
-
getAddedProperties
public static Map<org.alfresco.service.namespace.QName,Serializable> getAddedProperties(Map<org.alfresco.service.namespace.QName,Serializable> before, Map<org.alfresco.service.namespace.QName,Serializable> after)
Utility method to get properties which were added as part of a change.- Parameters:
before- the properties before (may benull).after- the properties after (may benull).- Returns:
- a map of values that were added along with their new values.
- Since:
- Odin
-
getRemovedProperties
public static Map<org.alfresco.service.namespace.QName,Serializable> getRemovedProperties(Map<org.alfresco.service.namespace.QName,Serializable> before, Map<org.alfresco.service.namespace.QName,Serializable> after)
Utility method to get properties which were removed as part of a change.- Parameters:
before- the properties before (may benull).after- the properties after (may benull).- Returns:
- a map of values that were removed along with their old values.
- Since:
- Odin
-
getChangedProperties
public static Map<org.alfresco.service.namespace.QName,Serializable> getChangedProperties(Map<org.alfresco.service.namespace.QName,Serializable> before, Map<org.alfresco.service.namespace.QName,Serializable> after)
Utility method to get properties which were changed (but not added or removed) as part of a change.- Parameters:
before- the properties before (may benull).after- the properties after (may benull).- Returns:
- a map of values that were changed along with their new values.
- Since:
- Odin
-
getUnchangedProperties
public static Map<org.alfresco.service.namespace.QName,Serializable> getUnchangedProperties(Map<org.alfresco.service.namespace.QName,Serializable> before, Map<org.alfresco.service.namespace.QName,Serializable> after)
Utility method to get properties which were unchanged as part of a change.- Parameters:
before- the properties before (may benull).after- the properties after (may benull).- Returns:
- a map of values that were unchanged along with their values.
- Since:
- Odin
-
-