Interface MapContextVariables
-
- All Superinterfaces:
ContextVariables
- All Known Implementing Classes:
MapContextVariablesImpl
public interface MapContextVariables extends ContextVariables
Variables provider backed by a map of name-value pairs- Author:
- Yegor.Yarko Date: 25.08.2008
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Object
get(String name)
Map<String,Object>
getAll()
Object
put(String name, Object value)
Adds a variable to the backing mapvoid
putAll(Map<String,Object> fromMap)
Adds multiple variables to the backing mapObject
remove(String name)
Removes variable with the name from the backing mapint
size()
Returns the number of variables in this variables provider.
-
-
-
Method Detail
-
get
@Nullable Object get(@NotNull String name)
- Specified by:
get
in interfaceContextVariables
- Parameters:
name
- the name of the variable- Returns:
- the variable stored or null is the variable with the name cannot be found.
-
remove
Object remove(@NotNull String name)
Removes variable with the name from the backing map- Parameters:
name
- name of the variable to be removed- Returns:
- previous value associated with specified name, or null if there was no mapping for name.
-
put
@Nullable Object put(@NotNull String name, @NotNull Object value)
Adds a variable to the backing map- Parameters:
name
- name of the variable to addvalue
- value of the variable- Returns:
- previous value associated with specified name, or null if there was no mapping for name
-
putAll
void putAll(Map<String,Object> fromMap)
Adds multiple variables to the backing map- Parameters:
fromMap
- the map to add variables form
-
size
int size()
Description copied from interface:ContextVariables
Returns the number of variables in this variables provider. This is the size of the map returned by getAll method.- Specified by:
size
in interfaceContextVariables
- Returns:
- the size of the backing map
-
getAll
@NotNull Map<String,Object> getAll()
- Specified by:
getAll
in interfaceContextVariables
- Returns:
- a copy of the backing map
-
-