jetbrains.buildServer.parameters.impl
Class DynamicContextVariables

java.lang.Object
  extended by jetbrains.buildServer.parameters.impl.DynamicContextVariables
All Implemented Interfaces:
ContextVariables

public class DynamicContextVariables
extends java.lang.Object
implements ContextVariables

A variable provider that provides values using SingleValueProvider

Author:
Yegor.Yarko Date: 30.08.2008

Field Summary
protected  java.util.Map<java.lang.String,SingleValueProvider> myProviders
           
 
Constructor Summary
DynamicContextVariables()
           
 
Method Summary
 java.lang.Object get(java.lang.String name)
          Calculates the variable value using the configured provider for the name and returns it
 java.util.Map<java.lang.String,java.lang.Object> getAll()
           
 java.lang.Object put(java.lang.String name, SingleValueProvider provider)
          Adds a variable to the provider
 java.lang.Object remove(java.lang.String name)
          Removes the variable form the provider
 int size()
          Returns the number of variables in this variables provider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myProviders

protected java.util.Map<java.lang.String,SingleValueProvider> myProviders
Constructor Detail

DynamicContextVariables

public DynamicContextVariables()
Method Detail

put

public java.lang.Object put(@NotNull
                            java.lang.String name,
                            @NotNull
                            SingleValueProvider provider)
Adds a variable to the provider

Parameters:
name - the name of the variable to add
provider - 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 java.lang.Object remove(@NotNull
                               java.lang.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 java.lang.Object get(@NotNull
                                     java.lang.String name)
Calculates the variable value using the configured provider for the name and returns it

Specified by:
get in interface ContextVariables
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 interface ContextVariables
Returns:
the number of variables stored in the provider

getAll

@NotNull
public java.util.Map<java.lang.String,java.lang.Object> getAll()
Specified by:
getAll in interface ContextVariables
Returns:
all the variables available through this provider