Class PropertyMap

All Implemented Interfaces:
Serializable, Cloneable, Map<QName,Serializable>

public class PropertyMap extends HashMap<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:
  • Field Details

    • EMPTY_MAP

      public static final Map<QName,Serializable> EMPTY_MAP
      A static empty map to us when having to deal with nulls
  • Constructor Details

    • PropertyMap

      public PropertyMap(int initialCapacity, float loadFactor)
      See Also:
    • PropertyMap

      public PropertyMap(int initialCapacity)
      See Also:
    • PropertyMap

      public PropertyMap()
      See Also:
  • Method Details

    • getBeforeAndAfterMapsForChanges

      public static Pair<Map<QName,Serializable>,Map<QName,Serializable>> getBeforeAndAfterMapsForChanges(Map<QName,Serializable> before, Map<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<QName,Serializable> getAddedProperties(Map<QName,Serializable> before, Map<QName,Serializable> after)
      Utility method to get properties which were added as part of a change.
      Parameters:
      before - the properties before (may be null).
      after - the properties after (may be null).
      Returns:
      a map of values that were added along with their new values.
      Since:
      Odin
    • getRemovedProperties

      public static Map<QName,Serializable> getRemovedProperties(Map<QName,Serializable> before, Map<QName,Serializable> after)
      Utility method to get properties which were removed as part of a change.
      Parameters:
      before - the properties before (may be null).
      after - the properties after (may be null).
      Returns:
      a map of values that were removed along with their old values.
      Since:
      Odin
    • getChangedProperties

      public static Map<QName,Serializable> getChangedProperties(Map<QName,Serializable> before, Map<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 be null).
      after - the properties after (may be null).
      Returns:
      a map of values that were changed along with their new values.
      Since:
      Odin
    • getUnchangedProperties

      public static Map<QName,Serializable> getUnchangedProperties(Map<QName,Serializable> before, Map<QName,Serializable> after)
      Utility method to get properties which were unchanged as part of a change.
      Parameters:
      before - the properties before (may be null).
      after - the properties after (may be null).
      Returns:
      a map of values that were unchanged along with their values.
      Since:
      Odin