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, waitbuilder, extend, getExtension, newDefaultInstance, newExtensionmergeprotected 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 VersionedPropertySetpublic <T> T get(Property<T> prop)
PropertyValueSourceget in interface PropertyValueSourceprotected <T> T getSuperValue(Property<T> prop)
protected boolean goToSuper(Property<?> prop)
public <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.protected void setImpl(Property prop, java.lang.Object val)
public <T> void set(Property<T> prop, T value)
set in interface MutablePropertyValueSourcepublic void set(PropertyValue propValue)
set in interface MutablePropertyValueSourcepublic void remove(Property<?> prop)
remove in interface MutablePropertyValueSourcepublic void revert(Property<?> prop)
revert in interface PropertySetEditpublic boolean contains(Property<?> prop)
contains in interface PropertyValueSourcepublic boolean isExtended(Property<?> prop)
PropertySetisExtended in interface PropertySetpublic boolean isInherited(Property<?> prop)
PropertySetisInherited in interface PropertySetpublic boolean isModified(Property<?> property)
isModified in interface PropertySetEditisModified in interface VersionedPropertySetpublic java.util.Collection<Property<?>> getProperties()
getProperties in interface PropertyValueSourcepublic java.util.List<PropertyValue> getValues()
getValues in interface PropertyValueSourcepublic java.util.Iterator<PropertyValue> iterator()
iterator in interface java.lang.Iterable<PropertyValue>protected boolean isRemoved(Property<?> prop)