public abstract class AbstractExtendedPropertySet<T extends PropertySet> extends java.lang.Object implements PropertySet
| Modifier and Type | Field and Description |
|---|---|
protected T |
local |
protected T |
parent |
EMPTY| Modifier | Constructor and Description |
|---|---|
protected |
AbstractExtendedPropertySet()
Protected, because only sub classes can set the data.
|
|
AbstractExtendedPropertySet(T local,
T parent)
Use the static function if you want to optionally create this only when necessary.
|
| Modifier and Type | Method and Description |
|---|---|
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() |
PropertySet |
getExtension()
This returns an object that represents the value only for the most "local" level.
|
protected <T> T |
getImpl(Property<T> prop,
T orElse,
boolean orDefault) |
T |
getLocal() |
protected T |
getOrCreateLocal() |
<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. |
T |
getParent() |
<T> T |
getParentProperty(Property<T> prop) |
java.util.Collection<Property<?>> |
getProperties() |
java.util.List<PropertyValue> |
getValues() |
protected abstract T |
instantiateLocal() |
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.
|
java.util.Iterator<PropertyValue> |
iterator() |
void |
merge(PropertySet other,
boolean localDefinitionsOnly)
Merges the values from other collection into this one.
|
void |
remove(Property<?> prop) |
<T> void |
set(Property<T> prop,
T value) |
void |
set(PropertyValue propValue) |
protected void |
setImpl(Property prop,
java.lang.Object val) |
void |
setLocal(T value) |
void |
setParent(T value) |
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitbuilder, extend, newDefaultInstance, newExtensionprotected T extends PropertySet parent
protected T extends PropertySet local
public AbstractExtendedPropertySet(T local, T parent)
protected AbstractExtendedPropertySet()
public T getLocal()
public T getParent()
public void setLocal(T value)
public void setParent(T value)
protected <T> T getImpl(Property<T> prop, T orElse, boolean orDefault)
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> T getParentProperty(Property<T> prop)
protected abstract T instantiateLocal()
protected T getOrCreateLocal()
public <T> void set(Property<T> prop, T value)
set in interface MutablePropertyValueSourcepublic void set(PropertyValue propValue)
set in interface MutablePropertyValueSourceprotected void setImpl(Property prop, java.lang.Object val)
public void remove(Property<?> prop)
remove in interface MutablePropertyValueSourcepublic boolean contains(Property<?> prop)
contains in interface PropertyValueSourcepublic 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>public boolean isExtended(Property<?> prop)
PropertySetisExtended in interface PropertySetpublic boolean isInherited(Property<?> prop)
PropertySetisInherited in interface PropertySetpublic PropertySet getExtension()
ExtendablegetExtension in interface Extendable<PropertySet>getExtension in interface PropertySetpublic java.lang.String toString()
toString in class java.lang.Objectpublic void merge(PropertySet other, boolean localDefinitionsOnly)
Mergablemerge in interface Mergable<PropertySet>merge in interface MutablePropertyValueSource