Class DynamicContextVariables
- java.lang.Object
-
- jetbrains.buildServer.parameters.impl.DynamicContextVariables
-
- All Implemented Interfaces:
ContextVariables
public class DynamicContextVariables extends Object implements ContextVariables
A variable provider that provides values using SingleValueProvider- Author:
- Yegor.Yarko Date: 30.08.2008
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,SingleValueProvider>
myProviders
-
Constructor Summary
Constructors Constructor Description DynamicContextVariables()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
get(String name)
Calculates the variable value using the configured provider for the name and returns itMap<String,Object>
getAll()
Object
put(String name, SingleValueProvider provider)
Adds a variable to the providerObject
remove(String name)
Removes the variable form the providerint
size()
Returns the number of variables in this variables provider.
-
-
-
Field Detail
-
myProviders
protected Map<String,SingleValueProvider> myProviders
-
-
Method Detail
-
put
public Object put(@NotNull String name, @NotNull SingleValueProvider provider)
Adds a variable to the provider- Parameters:
name
- the name of the variable to addprovider
- provider to use to get the variable value- Returns:
- previous value associated with specified name, or null if there was no mapping for name
-
remove
public Object remove(@NotNull String name)
Removes the variable form the provider- Parameters:
name
- name whose mapping is to be removed from the map.- Returns:
- previous value associated with specified name, or null if there was no mapping for name
-
get
@Nullable public Object get(@NotNull String name)
Calculates the variable value using the configured provider for the name and returns it- Specified by:
get
in interfaceContextVariables
- Parameters:
name
- the name of the variable- Returns:
- the variable, which is calculated using the single value provider associated with the name
-
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
- Returns:
- the number of variables stored in the provider
-
getAll
@NotNull public Map<String,Object> getAll()
- Specified by:
getAll
in interfaceContextVariables
- Returns:
- all the variables available through this provider
-
-