jetbrains.buildServer.parameters.impl
Class MapContextVariablesImpl

java.lang.Object
  extended by jetbrains.buildServer.parameters.impl.MapContextVariablesImpl
All Implemented Interfaces:
ContextVariables, MapContextVariables

public class MapContextVariablesImpl
extends java.lang.Object
implements MapContextVariables

Author:
Yegor.Yarko Date: 24.08.2008

Constructor Summary
MapContextVariablesImpl()
          Creates empty variables provider.
MapContextVariablesImpl(java.util.Map<java.lang.String,java.lang.Object> variables)
           
 
Method Summary
 java.lang.Object get(java.lang.String name)
           
 java.util.Map<java.lang.String,java.lang.Object> getAll()
           
 java.lang.Object put(java.lang.String name, java.lang.Object value)
          Adds a variable to the backing map
 void putAll(java.util.Map<java.lang.String,java.lang.Object> fromMap)
          Adds multiple variables to the backing map
 java.lang.Object remove(java.lang.String name)
          Removes variable with the name from the backing map
 int size()
          Returns the number of variables in this variables provider.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MapContextVariablesImpl

public MapContextVariablesImpl()
Creates empty variables provider.


MapContextVariablesImpl

public MapContextVariablesImpl(java.util.Map<java.lang.String,java.lang.Object> variables)
Parameters:
variables - variables map to use as initializer. A copy will be created as backing storage.
Method Detail

get

@Nullable
public java.lang.Object get(@NotNull
                                     java.lang.String name)
Specified by:
get in interface ContextVariables
Specified by:
get in interface MapContextVariables
Parameters:
name - the name of the variable
Returns:
the variable stored or null is the variable with the name cannot be found.

remove

public java.lang.Object remove(@NotNull
                               java.lang.String name)
Description copied from interface: MapContextVariables
Removes variable with the name from the backing map

Specified by:
remove in interface MapContextVariables
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 java.lang.Object put(@NotNull
                                     java.lang.String name,
                                     @NotNull
                                     java.lang.Object value)
Description copied from interface: MapContextVariables
Adds a variable to the backing map

Specified by:
put in interface MapContextVariables
Parameters:
name - name of the variable to add
value - value of the variable
Returns:
revious value associated with specified name, or null if there was no mapping for name

putAll

public void putAll(java.util.Map<java.lang.String,java.lang.Object> fromMap)
Description copied from interface: MapContextVariables
Adds multiple variables to the backing map

Specified by:
putAll in interface MapContextVariables
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 interface ContextVariables
Specified by:
size in interface MapContextVariables
Returns:
the size of the backing map

getAll

@NotNull
public java.util.Map<java.lang.String,java.lang.Object> getAll()
Specified by:
getAll in interface ContextVariables
Specified by:
getAll in interface MapContextVariables
Returns:
a copy of the backing map

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object