- 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>
-
- io.github.mmm.property.container.collection.CollectionProperty<Set<E>,E>
-
- io.github.mmm.property.container.set.SetProperty<E>
-
- Type Parameters:
E
- type of thecontained elements
.
- All Implemented Interfaces:
EventSource<ObservableEvent<Set<E>>,ObservableEventListener<? super Set<E>>>
,MarshallableObject
,Marshaller<Object>
,Marshalling<Object>
,MarshallingObject
,UnmarshallableObject
,Unmarshaller<Object>
,io.github.mmm.property.container.collection.ReadableCollectionProperty<Set<E>,E>
,io.github.mmm.property.container.collection.WritableCollectionProperty<Set<E>,E>
,ReadableContainerProperty<Set<E>,E>
,ReadableSetProperty<E>
,WritableSetProperty<E>
,WritableContainerProperty<Set<E>,E>
,ReadableProperty<Set<E>>
,WritableProperty<Set<E>>
,Validatable
,ReadableCollectionValue<Set<E>,E>
,WritableCollectionValue<Set<E>,E>
,ReadableContainerValue<Set<E>,E>
,ReadableSetValue<E>
,WritableSetValue<E>
,WritableContainerValue<Set<E>,E>
,ReadableObjectValue<Set<E>>
,ReadableTypedObjectValue<Set<E>>
,WritableObjectValue<Set<E>>
,ObservableValue<Set<E>>
,WritableObservableValue<Set<E>>
,PropertyPath<Set<E>>
,ReadableTypedValue<Set<E>>
,ReadableValue<Set<E>>
,TypedPropertyPath<Set<E>>
,WritableValue<Set<E>>
,Cloneable
,Supplier<Set<E>>
public class SetProperty<E> extends io.github.mmm.property.container.collection.CollectionProperty<Set<E>,E> implements WritableSetProperty<E>
Implementation ofWritableSetProperty
.- Since:
- 1.0.0
-
-
Field Summary
-
Fields inherited from class io.github.mmm.property.container.ContainerProperty
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 SetProperty(String name, Property<E> valueProperty)
The constructor.SetProperty(String name, Property<E> valueProperty, PropertyMetadata<Set<E>> metadata)
The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Set<E>
doGet()
protected void
doSet(Set<E> newValue)
ChangeAwareSet<E>
getChangeAwareValue()
boolean
isChangeAware()
-
Methods inherited from class io.github.mmm.property.container.collection.CollectionProperty
doValidate, read, write
-
Methods inherited from class io.github.mmm.property.container.ContainerProperty
emptyProperty, getValueProperty, invalidateProperties, isValueEqual, isValueMutable, sizeProperty
-
Methods inherited from class io.github.mmm.property.Property
clearValidationResult, clone, copy, doValidate, equals, get, getMetadata, getName, getReadOnly, hashCode, isReadOnly, isValid, readObject, requireWritable, setWithChange, toString, validate, writeObject
-
Methods inherited from class io.github.mmm.value.observable.AbstractWritableObservableValue
bindInternal, bindOneWay, bindTwoWay, 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.collection.ReadableCollectionValue
size
-
Methods inherited from interface io.github.mmm.property.container.ReadableContainerProperty
emptyProperty, sizeProperty
-
Methods inherited from interface io.github.mmm.value.observable.container.ReadableContainerValue
isEmpty
-
Methods inherited from interface io.github.mmm.value.observable.object.ReadableObjectValue
getValue
-
Methods inherited from interface io.github.mmm.property.ReadableProperty
getMetadata, getName, isReadOnly, isTransient, isValid
-
Methods inherited from interface io.github.mmm.value.observable.container.set.ReadableSetValue
getSafe, 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
getValueProperty
-
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.observable.container.set.WritableSetValue
getOrCreate
-
Methods inherited from interface io.github.mmm.value.WritableValue
set
-
-
-
-
Constructor Detail
-
SetProperty
public SetProperty(String name, Property<E> valueProperty)
The constructor.- Parameters:
name
- thename
.valueProperty
- thevalue property
.
-
SetProperty
public SetProperty(String name, Property<E> valueProperty, PropertyMetadata<Set<E>> metadata)
The constructor.- Parameters:
name
- thename
.valueProperty
- thevalue property
.metadata
- themetadata
.
-
-
Method Detail
-
doGet
protected Set<E> doGet()
- Specified by:
doGet
in classAbstractWritableObservableValue<Set<E>>
- Returns:
- the internal
value
.
-
doSet
protected void doSet(Set<E> newValue)
- Specified by:
doSet
in classAbstractWritableObservableValue<Set<E>>
- Parameters:
newValue
- the newvalue
to set.- See Also:
AbstractWritableObservableValue.set(Object)
-
isChangeAware
public boolean isChangeAware()
- Specified by:
isChangeAware
in interfaceWritableContainerProperty<Set<E>,E>
- Returns:
true
ifchange aware value
has been initialized,false
otherwise.
-
getChangeAwareValue
public ChangeAwareSet<E> getChangeAwareValue()
- Specified by:
getChangeAwareValue
in interfaceio.github.mmm.property.container.collection.WritableCollectionProperty<Set<E>,E>
- Specified by:
getChangeAwareValue
in interfaceWritableContainerProperty<Set<E>,E>
- Specified by:
getChangeAwareValue
in interfaceWritableSetProperty<E>
- Returns:
- the
value
asChangeAwareContainer
. Will be initialized on the first call of this method. Unlessinitialized
, a container property is lightweight just as other regular properties. Once this method was called, theChangeAwareContainer
is initialized and triggers change events for modifications of the container instance itself. Calls toWritableValue.set(Object)
will implicitly change thisChangeAwareContainer
such that in only contains what the provided new value contains. The instance of theChangeAwareContainer
returned by this method always remains the same.
-
-