public class ImmutablePropertySet extends java.lang.Object implements PropertySet
EMPTY
Constructor and Description |
---|
ImmutablePropertySet() |
ImmutablePropertySet(PropertySet internal) |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(Property<?> prop) |
PropertySet |
extend(PropertySet parent)
If called on a child, gets the extension with the given parent.
|
void |
forEach(java.util.function.Consumer<? super PropertyValue> action) |
<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.
|
<T> T |
getOrDefault(Property<T> prop) |
<T> T |
getOrElse(Property<T> prop,
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() |
java.util.List<PropertyValue> |
getValues() |
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) |
void |
merge(PropertySet other,
boolean local)
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) |
java.util.Spliterator<PropertyValue> |
spliterator() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
builder, newDefaultInstance, newExtension
public ImmutablePropertySet()
public ImmutablePropertySet(PropertySet internal)
public void merge(PropertySet other)
merge
in interface Mergable<PropertySet>
public void merge(PropertySet other, boolean local)
Mergable
merge
in interface Mergable<PropertySet>
merge
in interface MutablePropertyValueSource
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 <T> T get(Property<T> prop)
PropertyValueSource
get
in interface PropertyValueSource
public boolean contains(Property<?> prop)
contains
in interface PropertyValueSource
public java.util.Collection<Property<?>> getProperties()
getProperties
in interface PropertyValueSource
public <T> T getOrDefault(Property<T> prop)
getOrDefault
in interface PropertyValueSource
Property.getDefaultValue()
if not present.public java.util.List<PropertyValue> getValues()
getValues
in interface PropertyValueSource
public PropertySet extend(PropertySet parent)
Extendable
extend
in interface Extendable<PropertySet>
extend
in interface PropertySet
public java.util.Iterator<PropertyValue> iterator()
iterator
in interface java.lang.Iterable<PropertyValue>
public <T> T getOrElse(Property<T> prop, T value)
PropertyValueSource
Property
, or else fall back to value if it's not present.getOrElse
in interface PropertyValueSource
prop
- The Property
for which a value is to be retrieved.value
- The value to default to if property isn't present.public PropertySet getExtension()
Extendable
getExtension
in interface Extendable<PropertySet>
getExtension
in interface PropertySet
public void forEach(java.util.function.Consumer<? super PropertyValue> action)
forEach
in interface java.lang.Iterable<PropertyValue>
public boolean isExtended(Property<?> prop)
PropertySet
isExtended
in interface PropertySet
public boolean isInherited(Property<?> prop)
PropertySet
isInherited
in interface PropertySet
public java.util.Spliterator<PropertyValue> spliterator()
spliterator
in interface java.lang.Iterable<PropertyValue>