public class PropertySetConfig extends java.lang.Object implements VersionedPropertySet, PropertySetEdit
Modifier and Type | Field and Description |
---|---|
protected PropertySetDiff |
edit |
protected PropertySet |
source |
EMPTY
Constructor and Description |
---|
PropertySetConfig(PropertySet source) |
PropertySetConfig(PropertySet source,
PropertySetDiff editTarget) |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(Property<?> prop) |
static PropertySetConfig |
create(PropertySet source)
Returns a wrapping PropertySetConfig, unless the source already is one, then just casts it.
|
protected PropertySetDiff |
createDiff() |
void |
discardChanges() |
<T> T |
get(Property<T> prop)
Retrieves the value of the property, or null if this set doesn't contain that property.
|
int |
getCount() |
PropertySetDiff |
getEdit() |
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() |
PropertySet |
getSource() |
protected <T> T |
getSuperValue(Property<T> prop) |
java.util.List<PropertyValue> |
getValues() |
protected boolean |
goToSuper(Property<?> prop) |
boolean |
isExtended(Property<?> prop)
Returns whether this property set contains a value for the prop, and the prop was actually inherited.
|
boolean |
isInherited(Property<?> prop)
Indicates whether the property was inherited from a parent type.
|
boolean |
isModified(Property<?> property) |
protected boolean |
isRemoved(Property<?> prop) |
java.util.Iterator<PropertyValue> |
iterator() |
void |
mergeDiffToSource() |
void |
remove(Property<?> prop) |
void |
revert(Property<?> prop) |
<T> void |
set(Property<T> prop,
T value) |
void |
set(PropertyValue propValue) |
protected void |
setImpl(Property prop,
java.lang.Object val) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
builder, extend, getExtension, newDefaultInstance, newExtension
merge
protected PropertySet source
protected PropertySetDiff edit
public PropertySetConfig(PropertySet source, PropertySetDiff editTarget)
public PropertySetConfig(PropertySet source)
public static PropertySetConfig create(PropertySet source)
public PropertySet getSource()
public PropertySetDiff getEdit()
protected PropertySetDiff createDiff()
public void mergeDiffToSource()
public void discardChanges()
public java.util.Set<Property<?>> getModified()
getModified
in interface VersionedPropertySet
public <T> T get(Property<T> prop)
PropertyValueSource
get
in interface PropertyValueSource
protected <T> T getSuperValue(Property<T> prop)
protected boolean goToSuper(Property<?> prop)
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
property
- The Property
for which a value is to be retrieved.value
- The value to default to if property isn't present.protected void setImpl(Property prop, java.lang.Object val)
public <T> void set(Property<T> prop, T value)
set
in interface MutablePropertyValueSource
public void set(PropertyValue propValue)
set
in interface MutablePropertyValueSource
public void remove(Property<?> prop)
remove
in interface MutablePropertyValueSource
public void revert(Property<?> prop)
revert
in interface PropertySetEdit
public boolean contains(Property<?> prop)
contains
in interface PropertyValueSource
public boolean isExtended(Property<?> prop)
PropertySet
isExtended
in interface PropertySet
public boolean isInherited(Property<?> prop)
PropertySet
isInherited
in interface PropertySet
public boolean isModified(Property<?> property)
isModified
in interface PropertySetEdit
isModified
in interface VersionedPropertySet
public java.util.Collection<Property<?>> getProperties()
getProperties
in interface PropertyValueSource
public java.util.List<PropertyValue> getValues()
getValues
in interface PropertyValueSource
public java.util.Iterator<PropertyValue> iterator()
iterator
in interface java.lang.Iterable<PropertyValue>
protected boolean isRemoved(Property<?> prop)