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<Map<K,V>,V>
io.github.mmm.property.container.map.MapProperty<K,V>
- All Implemented Interfaces:
io.github.mmm.event.EventSource<ObservableEvent<Map<K,
,V>>, ObservableEventListener<? super Map<K, V>>> io.github.mmm.marshall.MarshallableObject
,io.github.mmm.marshall.Marshaller<Object>
,io.github.mmm.marshall.Marshalling<Object>
,io.github.mmm.marshall.MarshallingObject
,io.github.mmm.marshall.UnmarshallableObject
,io.github.mmm.marshall.Unmarshaller<Object>
,AttributeReadOnly
,ReadableMapProperty<K,
,V> WritableMapProperty<K,
,V> ReadableContainerProperty<Map<K,
,V>, V> WritableContainerProperty<Map<K,
,V>, V> ReadableProperty<Map<K,
,V>> WritableProperty<Map<K,
,V>> Validatable
,io.github.mmm.value.CriteriaObject<Map<K,
,V>> ObservableMapValue<K,
,V> ReadableMapValue<K,
,V> WritableMapValue<K,
,V> ObservableContainerValue<Map<K,
,V>, V> ReadableContainerValue<Map<K,
,V>, V> WritableContainerValue<Map<K,
,V>, V> ReadableObjectValue<Map<K,
,V>> ReadableTypedObjectValue<Map<K,
,V>> WritableObjectValue<Map<K,
,V>> ObservableValue<Map<K,
,V>> WritableObservableValue<Map<K,
,V>> io.github.mmm.value.PropertyPath<Map<K,
,V>> io.github.mmm.value.ReadablePath
,io.github.mmm.value.ReadableTypedValue<Map<K,
,V>> io.github.mmm.value.ReadableValue<Map<K,
,V>> io.github.mmm.value.TypedPropertyPath<Map<K,
,V>> io.github.mmm.value.WritableValue<Map<K,
,V>> Cloneable
,Comparable<ReadableProperty<?>>
,Supplier<Map<K,
V>>
public class MapProperty<K,V>
extends ContainerProperty<Map<K,V>,V>
implements WritableMapProperty<K,V>
Implementation of
WritableMapProperty
.- Since:
- 1.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.mmm.value.ReadablePath
io.github.mmm.value.ReadablePath.PathBuilder
-
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.container.map.ReadableMapProperty
METADATA_KEY_KEY_PROPERTY
Fields inherited from interface io.github.mmm.property.WritableProperty
NO_PROPERTIES
-
Constructor Summary
ConstructorsConstructorDescriptionMapProperty
(String name, WritableSimpleProperty<K> keyProperty, WritableProperty<V> valueProperty) The constructor.MapProperty
(String name, WritableSimpleProperty<K> keyProperty, WritableProperty<V> valueProperty, PropertyMetadata<Map<K, V>> metadata) The constructor. -
Method Summary
Modifier and TypeMethodDescriptiondoGet()
protected void
protected ValidationResult
doValidate
(Map<K, V> map, String source) Called fromProperty.validate()
in case re-validation is required.boolean
void
read
(io.github.mmm.marshall.StructuredReader reader) void
write
(io.github.mmm.marshall.StructuredWriter writer) protected void
Implementation ofwrite(StructuredWriter)
for amap key
.protected void
writeValue
(io.github.mmm.marshall.StructuredWriter writer, V mapValue) Implementation ofwrite(StructuredWriter)
for amap value
.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, compareTo, copy, doValidate, equals, get, getMetadata, getName, getReadOnly, hashCode, isReadOnly, isSensitive, 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.property.AttributeReadOnly
isReadOnly
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface io.github.mmm.event.EventSource
addListener, addListener, addWeakListener, removeListener
Methods inherited from interface io.github.mmm.marshall.MarshallableObject
writeObject
Methods inherited from interface io.github.mmm.value.observable.ObservableValue
toString
Methods inherited from interface io.github.mmm.value.PropertyPath
pathSegment
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.container.map.ReadableMapValue
getValueClass, size
Methods inherited from interface io.github.mmm.value.observable.object.ReadableObjectValue
getSafe, getValue
Methods inherited from interface io.github.mmm.value.ReadablePath
path, path, path
Methods inherited from interface io.github.mmm.property.ReadableProperty
computeSize, count, eq, eq, getMetadata, getName, getQualifiedName, getQualifiedName, getTypeMapper, isMandatory, isTransient, isValid, neq, neq, parentPath
Methods inherited from interface io.github.mmm.value.ReadableValue
get
Methods inherited from interface io.github.mmm.marshall.UnmarshallableObject
readObject
Methods inherited from interface io.github.mmm.validation.Validatable
validate, validateOrThrow
Methods inherited from interface io.github.mmm.property.container.WritableContainerProperty
getValueProperty
Methods inherited from interface io.github.mmm.value.observable.container.map.WritableMapValue
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
-
Constructor Details
-
MapProperty
public MapProperty(String name, WritableSimpleProperty<K> keyProperty, WritableProperty<V> valueProperty) The constructor.- Parameters:
name
- thename
.keyProperty
- thekey property
.valueProperty
- thevalue property
.
-
MapProperty
public MapProperty(String name, WritableSimpleProperty<K> keyProperty, WritableProperty<V> valueProperty, PropertyMetadata<Map<K, V>> metadata) The constructor.- Parameters:
name
- thename
.keyProperty
- thekey property
.valueProperty
- thevalue property
.metadata
- themetadata
.
-
-
Method Details
-
getKeyProperty
- Specified by:
getKeyProperty
in interfaceReadableMapProperty<K,
V> - Returns:
- the
ReadableProperty
representing the type of thekeys
of theMap
value
.
-
doGet
- Specified by:
doGet
in classAbstractWritableObservableValue<Map<K,
V>>
-
doSet
- Specified by:
doSet
in classAbstractWritableObservableValue<Map<K,
V>>
-
doValidate
Description copied from class:Property
Called fromProperty.validate()
in case re-validation is required.- Overrides:
doValidate
in classProperty<Map<K,
V>> - Parameters:
map
- thevalue
to validate.source
- thevalidation source
.- Returns:
- the
result of the validation
.
-
isChangeAware
public boolean isChangeAware()- Specified by:
isChangeAware
in interfaceWritableContainerProperty<K,
V> - Returns:
true
ifchange aware value
has been initialized,false
otherwise.
-
getChangeAwareValue
- Specified by:
getChangeAwareValue
in interfaceWritableContainerProperty<K,
V> - Specified by:
getChangeAwareValue
in interfaceWritableMapProperty<K,
V> - 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.
-
read
public void read(io.github.mmm.marshall.StructuredReader reader) -
write
public void write(io.github.mmm.marshall.StructuredWriter writer) -
writeKey
Implementation ofwrite(StructuredWriter)
for amap key
.- Parameters:
writer
- theStructuredWriter
.key
- themap key
to marshall.
-
writeValue
Implementation ofwrite(StructuredWriter)
for amap value
.- Parameters:
writer
- theStructuredWriter
.mapValue
- themap value
to marshall.
-