Module io.github.mmm.property
Package io.github.mmm.property.container
Class ContainerProperty<V,E>
- java.lang.Object
-
- io.github.mmm.event.AbstractEventSource<ObservableEvent<V>,ObservableEventListener<? super V>>
-
- io.github.mmm.value.observable.AbstractObservableValue<V>
-
- io.github.mmm.value.observable.AbstractWritableObservableValue<V>
-
- io.github.mmm.property.Property<V>
-
- io.github.mmm.property.container.ContainerProperty<V,E>
-
- All Implemented Interfaces:
EventSource<ObservableEvent<V>,ObservableEventListener<? super V>>,MarshallableObject,Marshaller<Object>,Marshalling<Object>,MarshallingObject,UnmarshallableObject,Unmarshaller<Object>,ReadableContainerProperty<V,E>,WritableContainerProperty<V,E>,ReadableProperty<V>,WritableProperty<V>,Validatable,ReadableContainerValue<V,E>,WritableContainerValue<V,E>,ReadableObjectValue<V>,ReadableTypedObjectValue<V>,WritableObjectValue<V>,ObservableValue<V>,WritableObservableValue<V>,PropertyPath<V>,ReadableTypedValue<V>,ReadableValue<V>,TypedPropertyPath<V>,WritableValue<V>,Cloneable,Supplier<V>
- Direct Known Subclasses:
io.github.mmm.property.container.collection.CollectionProperty,MapProperty
public abstract class ContainerProperty<V,E> extends Property<V> implements WritableContainerProperty<V,E>
Implementation ofWritableContainerProperty.- Since:
- 1.0.0
-
-
Field Summary
Fields Modifier and Type Field Description protected Property<E>valueProperty-
Fields inherited from interface io.github.mmm.property.container.ReadableContainerProperty
METADATA_KEY_COMPONENT_PROPERTY
-
Fields inherited from interface io.github.mmm.property.WritableProperty
NO_PROPERTIES
-
-
Constructor Summary
Constructors Constructor Description ContainerProperty(String name, Property<E> valueProperty)The constructor.ContainerProperty(String name, Property<E> valueProperty, PropertyMetadata<V> metadata)The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ReadableBooleanPropertyemptyProperty()Property<E>getValueProperty()protected voidinvalidateProperties()Invalidates internal properties such assizeProperty()andemptyProperty().protected booleanisValueEqual(V newValue, V oldValue)Null-safe check if twovaluesare considered equal (unchanged).booleanisValueMutable()ReadableIntegerPropertysizeProperty()-
Methods inherited from class io.github.mmm.property.Property
clearValidationResult, clone, copy, doValidate, doValidate, equals, get, getMetadata, getName, getReadOnly, hashCode, isReadOnly, isValid, read, readObject, requireWritable, setWithChange, toString, validate, write, writeObject
-
Methods inherited from class io.github.mmm.value.observable.AbstractWritableObservableValue
bindInternal, bindOneWay, bindTwoWay, doGet, doSet, isBoundOneWay, set, unbindOneWay, unbindTwoWay
-
Methods inherited from class io.github.mmm.value.observable.AbstractObservableValue
addListener, fireChange, fireEvent, fireEvent, fireEventFor, fireEventFor, fireEventWithOldValue, hasChangeAwareListeners, invalidate, removeListener, toString
-
Methods inherited from class io.github.mmm.event.AbstractEventSource
getEventAdapter, hasListeners
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.github.mmm.event.EventSource
addListener, addListener, addWeakListener, removeListener
-
Methods inherited from interface io.github.mmm.marshall.MarshallableObject
write, writeObject
-
Methods inherited from interface io.github.mmm.value.observable.ObservableValue
toString
-
Methods inherited from interface io.github.mmm.value.observable.container.ReadableContainerValue
isEmpty, size
-
Methods inherited from interface io.github.mmm.value.observable.object.ReadableObjectValue
getSafe, getValue
-
Methods inherited from interface io.github.mmm.property.ReadableProperty
getMetadata, getName, isReadOnly, isTransient, isValid
-
Methods inherited from interface io.github.mmm.value.ReadableTypedValue
getValueClass
-
Methods inherited from interface io.github.mmm.value.ReadableValue
get
-
Methods inherited from interface io.github.mmm.marshall.UnmarshallableObject
read, readObject
-
Methods inherited from interface io.github.mmm.validation.Validatable
validate
-
Methods inherited from interface io.github.mmm.property.container.WritableContainerProperty
getChangeAwareValue, isChangeAware
-
Methods inherited from interface io.github.mmm.value.observable.container.WritableContainerValue
getOrCreate
-
Methods inherited from interface io.github.mmm.value.observable.object.WritableObjectValue
setValue
-
Methods inherited from interface io.github.mmm.value.observable.WritableObservableValue
bindOneWay, bindTwoWay, isBoundOneWay, unbindOneWay, unbindTwoWay
-
Methods inherited from interface io.github.mmm.property.WritableProperty
copy, getReadOnly
-
Methods inherited from interface io.github.mmm.value.WritableValue
set
-
-
-
-
Field Detail
-
valueProperty
protected final Property<E> valueProperty
- See Also:
getValueProperty()
-
-
Constructor Detail
-
ContainerProperty
public ContainerProperty(String name, Property<E> valueProperty)
The constructor.- Parameters:
name- thename.valueProperty- thevalue property.
-
ContainerProperty
public ContainerProperty(String name, Property<E> valueProperty, PropertyMetadata<V> metadata)
The constructor.- Parameters:
name- thename.valueProperty- thevalue property.metadata- themetadata.
-
-
Method Detail
-
isValueMutable
public boolean isValueMutable()
- Overrides:
isValueMutablein classProperty<V>- Returns:
trueif thevalue typeof this property is mutable (e.g.CollectionorMap),falseotherwise (immutable datatype such asString,Boolean,Number,Temporal, etc.).
-
isValueEqual
protected boolean isValueEqual(V newValue, V oldValue)
Description copied from class:AbstractWritableObservableValueNull-safe check if twovaluesare considered equal (unchanged).- Overrides:
isValueEqualin classAbstractWritableObservableValue<V>- Parameters:
newValue- the new value.oldValue- the old value.- Returns:
trueif equal (unchanged),falseotherwise (changed),
-
getValueProperty
public Property<E> getValueProperty()
- Specified by:
getValuePropertyin interfaceReadableContainerProperty<V,E>- Specified by:
getValuePropertyin interfaceWritableContainerProperty<V,E>- Returns:
- the
ReadablePropertyrepresenting the type of the values (e.g. map values or collection elements) contained in the property containervalue.
-
sizeProperty
public ReadableIntegerProperty sizeProperty()
- Specified by:
sizePropertyin interfaceReadableContainerProperty<V,E>- Returns:
- an
ReadableIntegerPropertythat represents theCollection.size()property of thecontainer.
-
emptyProperty
public ReadableBooleanProperty emptyProperty()
- Specified by:
emptyPropertyin interfaceReadableContainerProperty<V,E>- Returns:
- an
ReadableBooleanPropertythat represents theemptyproperty of thecontainer.
-
invalidateProperties
protected void invalidateProperties()
Invalidates internal properties such assizeProperty()andemptyProperty().
-
-