Class PropertySetDiff

    • Constructor Detail

      • PropertySetDiff

        public PropertySetDiff()
      • PropertySetDiff

        public PropertySetDiff​(PropertySet copy)
    • Method Detail

      • isRemoved

        public boolean isRemoved​(Property<?> prop)
      • getModified

        public java.util.Set<Property<?>> getModified()
      • revert

        public void revert​(Property<?> property)
        Removes the property from the modified map, but unlike "remove", doesn't add it to the removed set.
        Specified by:
        revert in interface PropertySetEdit
      • hasChanges

        public boolean hasChanges()
      • getOrElse

        public <T> T getOrElse​(Property<T> property,
                               T value)
        Description copied from interface: PropertyValueSource
        Get the value for a given Property, or else fall back to value if it's not present.
        Specified by:
        getOrElse in interface PropertyValueSource
        property - The Property for which a value is to be retrieved.
        value - The value to default to if property isn't present.
        The value of property if present, value if not. Can return null if the value is null.
      • setRaw

        protected void setRaw​(Property<?> prop,
                              java.lang.Object value)
      • getRaw

        protected java.lang.Object getRaw​(Property<?> prop)
      • getCount

        public int getCount()
        For the diff, returns the combined size of modified and removed, so it can be used to see if there are any changes, as the value will be >0.
        Specified by:
        getCount in interface Countable
      • getRemoved

        public java.util.Collection<Property<?>> getRemoved()
      • getValues

        public java.util.List<PropertyValue> getValues()
        Description copied from interface: PropertyValueSource
        Returns the opaque PropertyValue objects. This can be useful when you want to avoid the strict type checking of the value, and it's important to note that if the property is bound, the value will be a BoundValue. Be very careful about overriding, and make sure to maintain the methodology of using getProperties to iterate and get (or getOrDefault), to get the value, because those are all handled differently by BoundPropertySets, ExtendedPropertySets, etc.
        Specified by:
        getValues in interface PropertyValueSource
      • iterator

        public java.util.Iterator<PropertyValue> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<PropertyValue>
      • isExtended

        public boolean isExtended​(Property<?> prop)
        The diff object always returns false for isExtended.
        Specified by:
        isExtended in interface PropertySet
      • isInherited

        public boolean isInherited​(Property<?> prop)
        Description copied from interface: PropertySet
        Indicates whether the property was inherited from a parent type.
        Specified by:
        isInherited in interface PropertySet
      • toString

        public java.lang.String toString()
        toString in class java.lang.Object
      • compactChanges

        public void compactChanges()