public class PropertySetDiff extends java.lang.Object implements PropertySet, MutablePropertyValueSetEdit
Constructor and Description |
---|
PropertySetDiff() |
PropertySetDiff(PropertySet copy) |
Modifier and Type | Method and Description |
---|---|
void |
compactChanges() |
boolean |
contains(Property<?> prop) |
<T> T |
get(Property<T> prop)
Retrieves the value of the property, or null if this set doesn't contain that property.
|
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.
|
<T> T |
getOrDefault(Property<T> prop) |
<T> T |
getOrElse(Property<T> property,
T value)
Get the value for a given
Property , or else fall back to value if it's not present. |
java.util.Collection<Property<?>> |
getProperties() |
protected java.lang.Object |
getRaw(Property<?> prop) |
java.util.Collection<Property<?>> |
getRemoved() |
java.util.List<PropertyValue> |
getValues() |
boolean |
hasChanges() |
boolean |
isExtended(Property<?> prop)
The diff object always returns false for isExtended.
|
boolean |
isInherited(Property<?> prop)
Indicates whether the property was inherited from a parent type.
|
boolean |
isModified(Property<?> prop) |
boolean |
isRemoved(Property<?> prop) |
java.util.Iterator<PropertyValue> |
iterator() |
void |
merge(PropertySet other)
Merges the values from other into this set.
|
void |
remove(Property<?> prop) |
void |
revert(Property<?> property)
Removes the property from the modified map, but unlike "remove", doesn't add it to the removed set.
|
<T> void |
set(Property<T> prop,
T value) |
void |
set(PropertyValue propValue) |
protected void |
setRaw(Property<?> prop,
java.lang.Object value) |
java.lang.String |
toString() |
public PropertySetDiff()
public PropertySetDiff(PropertySet copy)
public boolean isRemoved(Property<?> prop)
public boolean isModified(Property<?> prop)
isModified
in interface MutablePropertyValueSetEdit
public void revert(Property<?> property)
prop
- public boolean hasChanges()
public <T> T get(Property<T> prop)
PropertyValueSource
get
in interface PropertyValueSource
public <T> T getOrDefault(Property<T> prop)
getOrDefault
in interface PropertyValueSource
Property.getDefaultValue()
if not present.public <T> T getOrElse(Property<T> property, T value)
PropertyValueSource
Property
, or else fall back to value if it's not present.getOrElse
in interface PropertyValueSource
value
- The value to default to if property isn't present.public <T> void set(Property<T> prop, T value)
set
in interface MutablePropertyValueSource
public void set(PropertyValue propValue)
set
in interface MutablePropertyValueSource
protected void setRaw(Property<?> prop, java.lang.Object value)
protected java.lang.Object getRaw(Property<?> prop)
public void remove(Property<?> prop)
remove
in interface MutablePropertyValueSource
public boolean contains(Property<?> prop)
contains
in interface PropertyValueSource
public int getCount()
getCount
in interface PropertySet
public java.util.Collection<Property<?>> getProperties()
getProperties
in interface PropertySet
public java.util.Collection<Property<?>> getRemoved()
public java.util.List<PropertyValue> getValues()
getValues
in interface PropertySet
public java.util.Iterator<PropertyValue> iterator()
iterator
in interface java.lang.Iterable<PropertyValue>
public void merge(PropertySet other)
MutablePropertyValueSource
merge
in interface MutablePropertyValueSource
public boolean isExtended(Property<?> prop)
isExtended
in interface PropertyValueSource
public boolean isInherited(Property<?> prop)
PropertyValueSource
isInherited
in interface PropertyValueSource
public java.lang.String toString()
toString
in class java.lang.Object
public void compactChanges()