Class MapContextVariablesImpl
- java.lang.Object
-
- jetbrains.buildServer.parameters.impl.MapContextVariablesImpl
-
- All Implemented Interfaces:
ContextVariables
,MapContextVariables
public class MapContextVariablesImpl extends Object implements MapContextVariables
- Author:
- Yegor.Yarko Date: 24.08.2008
-
-
Constructor Summary
Constructors Constructor Description MapContextVariablesImpl()
Creates empty variables provider.MapContextVariablesImpl(Map<String,Object> variables)
-
Method Summary
All Methods Instance Methods Concrete 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.String
toString()
-
-
-
Method Detail
-
get
@Nullable public Object get(@NotNull String name)
- Specified by:
get
in interfaceContextVariables
- Specified by:
get
in interfaceMapContextVariables
- Parameters:
name
- the name of the variable- Returns:
- the variable stored or null is the variable with the name cannot be found.
-
remove
public Object remove(@NotNull String name)
Description copied from interface:MapContextVariables
Removes variable with the name from the backing map- Specified by:
remove
in interfaceMapContextVariables
- 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 public Object put(@NotNull String name, @NotNull Object value)
Description copied from interface:MapContextVariables
Adds a variable to the backing map- Specified by:
put
in interfaceMapContextVariables
- 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
public void putAll(Map<String,Object> fromMap)
Description copied from interface:MapContextVariables
Adds multiple variables to the backing map- Specified by:
putAll
in interfaceMapContextVariables
- Parameters:
fromMap
- the map to add variables form
-
size
public 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
- Specified by:
size
in interfaceMapContextVariables
- Returns:
- the size of the backing map
-
getAll
@NotNull public Map<String,Object> getAll()
- Specified by:
getAll
in interfaceContextVariables
- Specified by:
getAll
in interfaceMapContextVariables
- Returns:
- a copy of the backing map
-
-