Module org.jhotdraw8.fxcollection
Interface MapAccessor<T>
- Type Parameters:
T- The value type.
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
CompositeMapAccessor<T>,Key<T>,NonNullKey<T>,NonNullMapAccessor<T>,NullableKey<T>
- All Known Implementing Classes:
AbstractKey,NonNullListKey,NonNullObjectKey,NullableObjectKey,SetValueMapAccessor,TransientKey
A type safe accessor for maps.
Design pattern: Strategy
- Author:
- Werner Randelshofer
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsKey(Map<Key<?>, Object> map) Whether the map contains all keys required by this map accessor.Gets the value of the attribute denoted by this accessor from a Map.get(@NonNull ReadOnlyMap<? super Key<?>, Object> a) Returns the default value of this map accessor.getName()Returns the name string.Returns the raw value type of this map accessor.Returns the value type of this map accessor.booleanWhether the value needs to be made persistent.Puts the value of the attribute denoted by this accessor from a Map.Puts the value of the attribute denoted by this accessor from a Map.Removes the value of the attribute denoted by this accessor from a Map.remove(@NonNull ImmutableMap<Key<?>, Object> a) Removes the value of the attribute denoted by this accessor from a Map.default voidSets the value of the attribute denoted by this accessor from a Map.
-
Field Details
-
serialVersionUID
static final long serialVersionUID- See Also:
-
-
Method Details
-
containsKey
Whether the map contains all keys required by this map accessor.- Parameters:
map- a map- Returns:
- true if map contains all keys required by this map accessor.
-
getName
Returns the name string.- Returns:
- name string.
-
get
Gets the value of the attribute denoted by this accessor from a Map.- Parameters:
a- A Map.- Returns:
- The value of the attribute.
-
get
-
put
Puts the value of the attribute denoted by this accessor from a Map.- Parameters:
a- A map.value- The new value. Subclasses may require that the value is non-null.- Returns:
- The old value.
-
put
Puts the value of the attribute denoted by this accessor from a Map.- Parameters:
a- A map.value- The new value. Subclasses may require that the value is non-null.- Returns:
- The updated map.
-
set
Sets the value of the attribute denoted by this accessor from a Map.- Parameters:
a- A map.value- The new value. Subclasses may require that the value is non-null.
-
remove
Removes the value of the attribute denoted by this accessor from a Map.- Parameters:
a- A map.- Returns:
- The old value.
-
remove
Removes the value of the attribute denoted by this accessor from a Map.- Parameters:
a- A map.- Returns:
- The old value.
-
getValueType
Returns the value type of this map accessor.If the value type has type parameters, make sure to create it using
TypeToken. -
getRawValueType
Returns the raw value type of this map accessor. -
getDefaultValue
Returns the default value of this map accessor.The default value of an attribute or property is the value used when that attribute or property is not specified.
- Returns:
- the default value
-
isTransient
boolean isTransient()Whether the value needs to be made persistent.- Returns:
- true if transient
-