Class PropertyMap

    • Field Detail

      • EMPTY_MAP

        public static final Map<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 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