K
- the type of key used in the underlying mapV
- the type of parameter valuespublic class MapAccessor<K,V> extends Object implements DefinitionAccessor<V>
DefinitionAccessor
. Operations are
delegated to an existing Map
object.DefinitionAccessor.Identifier<T>
Constructor and Description |
---|
MapAccessor(Map<K,V> map)
Constructs a new
MapAccessor . |
MapAccessor(Map<K,V> map,
Set<K> notAutomatableKeys)
Constructs a new
MapAccessor . |
Modifier and Type | Method and Description |
---|---|
V |
get(DefinitionAccessor.Identifier<?> identifier)
Gets the value the given identifier is pointing at.
|
Set<DefinitionAccessor.Identifier<K>> |
identifiers()
Returns the set of identifiers associated with a value.
|
V |
set(DefinitionAccessor.Identifier<?> identifier,
Object value)
Sets a value pointed at by a given identifier with a given one.
|
public MapAccessor(Map<K,V> map)
MapAccessor
.map
- the map to wrappublic Set<DefinitionAccessor.Identifier<K>> identifiers()
DefinitionAccessor
identifiers
in interface DefinitionAccessor<V>
public V get(DefinitionAccessor.Identifier<?> identifier)
DefinitionAccessor
get
in interface DefinitionAccessor<V>
identifier
- the identifier to get the value forIllegalArgumentException
- if the given identifier is invalid or null
NotAutomatable.IllegalAutomationException
- if the given identifier cannot be automatedpublic V set(DefinitionAccessor.Identifier<?> identifier, Object value)
DefinitionAccessor
set
in interface DefinitionAccessor<V>
identifier
- the identifier pointing to the value to be setvalue
- the value the identifier is to point atClassCastException
- if given value's type does not match VIllegalArgumentException
- if the given identifier is invalid or null
NotAutomatable.IllegalAutomationException
- if the given identifier cannot be automated