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 Objectget(String name)Map<String,Object>getAll()Objectput(String name, Object value)Adds a variable to the backing mapvoidputAll(Map<String,Object> fromMap)Adds multiple variables to the backing mapObjectremove(String name)Removes variable with the name from the backing mapintsize()Returns the number of variables in this variables provider.
-
-
-
Method Detail
-
get
@Nullable Object get(@NotNull String name)
- Specified by:
getin 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:ContextVariablesReturns the number of variables in this variables provider. This is the size of the map returned by getAll method.- Specified by:
sizein interfaceContextVariables- Returns:
- the size of the backing map
-
getAll
@NotNull Map<String,Object> getAll()
- Specified by:
getAllin interfaceContextVariables- Returns:
- a copy of the backing map
-
-