Package spoon.support.util
Interface ImmutableMap
- All Known Implementing Classes:
ImmutableMapImpl
public interface ImmutableMap
An immutable map.
(eg unmodifiable storage of parameter name-value pairs).
The values may be primitive values or List, Set, Map of values.
All internal containers are unmodifiable too.
Internal class only, not in the public API.
-
Method Summary
-
Method Details
-
hasValue
- Parameters:
parameterName
- to be checked parameter name- Returns:
- true if there is defined some value for the parameter. null can be a value too
-
getValue
- Parameters:
parameterName
- the name of the parameter- Returns:
- a value of the parameter under the name `parameterNamer
-
putValue
- Parameters:
parameterName
- to be set parameter namevalue
- the new value- Returns:
- copies this
ImmutableMap
, sets the new value there and returns that copy
-
asMap
- Returns:
- underlying unmodifiable Map<String, Object>
-
checkpoint
ImmutableMap checkpoint()- Returns:
- a new instance of
ImmutableMap
, which inherits all values from thisImmutableMap
Any call ofputValue(String, Object)
is remembered in local Map of parameters. At the end of process thegetModifiedValues()
can be used to return all the parameters which were changed after localImmutableMap
was created
-
getModifiedValues
- Returns:
- the modified parameters since last call to
checkpoint()
-