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 ReadableBooleanProperty
emptyProperty()
Property<E>
getValueProperty()
protected void
invalidateProperties()
Invalidates internal properties such assizeProperty()
andemptyProperty()
.protected boolean
isValueEqual(V newValue, V oldValue)
Null-safe check if twovalues
are considered equal (unchanged).boolean
isValueMutable()
ReadableIntegerProperty
sizeProperty()
-
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:
isValueMutable
in classProperty<V>
- Returns:
true
if thevalue type
of this property is mutable (e.g.Collection
orMap
),false
otherwise (immutable datatype such asString
,Boolean
,Number
,Temporal
, etc.).
-
isValueEqual
protected boolean isValueEqual(V newValue, V oldValue)
Description copied from class:AbstractWritableObservableValue
Null-safe check if twovalues
are considered equal (unchanged).- Overrides:
isValueEqual
in classAbstractWritableObservableValue<V>
- Parameters:
newValue
- the new value.oldValue
- the old value.- Returns:
true
if equal (unchanged),false
otherwise (changed),
-
getValueProperty
public Property<E> getValueProperty()
- Specified by:
getValueProperty
in interfaceReadableContainerProperty<V,E>
- Specified by:
getValueProperty
in interfaceWritableContainerProperty<V,E>
- Returns:
- the
ReadableProperty
representing the type of the values (e.g. map values or collection elements) contained in the property containervalue
.
-
sizeProperty
public ReadableIntegerProperty sizeProperty()
- Specified by:
sizeProperty
in interfaceReadableContainerProperty<V,E>
- Returns:
- an
ReadableIntegerProperty
that represents theCollection.size()
property of thecontainer
.
-
emptyProperty
public ReadableBooleanProperty emptyProperty()
- Specified by:
emptyProperty
in interfaceReadableContainerProperty<V,E>
- Returns:
- an
ReadableBooleanProperty
that represents theempty
property of thecontainer
.
-
invalidateProperties
protected void invalidateProperties()
Invalidates internal properties such assizeProperty()
andemptyProperty()
.
-
-