public class PropertySetDiff extends java.lang.Object implements PropertySet, PropertySetEdit, VersionedPropertySet
EMPTY| 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.
|
java.util.Set<Property<?>> |
getModified() |
<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 |
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() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitbuilder, extend, getExtension, newDefaultInstance, newExtensionmergepublic PropertySetDiff()
public PropertySetDiff(PropertySet copy)
public boolean isRemoved(Property<?> prop)
public boolean isModified(Property<?> prop)
isModified in interface PropertySetEditisModified in interface VersionedPropertySetpublic java.util.Set<Property<?>> getModified()
getModified in interface VersionedPropertySetpublic void revert(Property<?> property)
revert in interface PropertySetEditpublic boolean hasChanges()
public <T> T get(Property<T> prop)
PropertyValueSourceget in interface PropertyValueSourcepublic <T> T getOrDefault(Property<T> prop)
getOrDefault in interface PropertyValueSourceProperty.getDefaultValue() if not present.public <T> T getOrElse(Property<T> property, T value)
PropertyValueSourceProperty, or else fall back to value if it's not present.getOrElse in interface PropertyValueSourceproperty - The Property for which a value is to be retrieved.value - The value to default to if property isn't present.public <T> void set(Property<T> prop, T value)
set in interface MutablePropertyValueSourcepublic void set(PropertyValue propValue)
set in interface MutablePropertyValueSourceprotected void setRaw(Property<?> prop, java.lang.Object value)
protected java.lang.Object getRaw(Property<?> prop)
public void remove(Property<?> prop)
remove in interface MutablePropertyValueSourcepublic boolean contains(Property<?> prop)
contains in interface PropertyValueSourcepublic int getCount()
public java.util.Collection<Property<?>> getProperties()
getProperties in interface PropertyValueSourcepublic java.util.Collection<Property<?>> getRemoved()
public java.util.List<PropertyValue> getValues()
getValues in interface PropertyValueSourcepublic java.util.Iterator<PropertyValue> iterator()
iterator in interface java.lang.Iterable<PropertyValue>public boolean isExtended(Property<?> prop)
isExtended in interface PropertySetpublic boolean isInherited(Property<?> prop)
PropertySetisInherited in interface PropertySetpublic java.lang.String toString()
toString in class java.lang.Objectpublic void compactChanges()