jetbrains.buildServer.parameters.impl
Class AbstractMapParametersProvider

java.lang.Object
  extended by jetbrains.buildServer.parameters.impl.AbstractMapParametersProvider
All Implemented Interfaces:
MapParametersProvider, ParametersProvider
Direct Known Subclasses:
MapParametersProviderImpl

public class AbstractMapParametersProvider
extends java.lang.Object
implements MapParametersProvider

Created by Eugene Petrenko (eugene.petrenko@gmail.com) Date: 14.06.11 20:01


Constructor Summary
AbstractMapParametersProvider(java.util.Map<java.lang.String,java.lang.String> parameters)
          Create map provider wrapping a given map.
 
Method Summary
 java.lang.String get(java.lang.String key)
           
 java.util.Map<java.lang.String,java.lang.String> getAll()
          Allows to get map of the provided parameters.
 void put(java.lang.String key, java.lang.String value)
           
 void putAll(java.util.Map<java.lang.String,java.lang.String> fromMap)
          Allows to add map of parameters into the backing map
 java.lang.String remove(java.lang.String key)
           
 int size()
          Returns the number of parameters in this parameters provider.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractMapParametersProvider

public AbstractMapParametersProvider(@NotNull
                                     java.util.Map<java.lang.String,java.lang.String> parameters)
Create map provider wrapping a given map. No copy is done, all requests are redirected to the given map Given map would be used for both read and writes

Parameters:
parameters - map to adapt to MapParametersProvider
Method Detail

get

public java.lang.String get(@NotNull
                            java.lang.String key)
Specified by:
get in interface ParametersProvider
Parameters:
key - the name of the parameter
Returns:
the value associated with a key, or null if the parameter with the key cannot be found.

remove

public java.lang.String remove(@NotNull
                               java.lang.String key)
Specified by:
remove in interface MapParametersProvider

put

public void put(@NotNull
                java.lang.String key,
                @NotNull
                java.lang.String value)
Specified by:
put in interface MapParametersProvider

putAll

public void putAll(@NotNull
                   java.util.Map<java.lang.String,java.lang.String> fromMap)
Allows to add map of parameters into the backing map

Specified by:
putAll in interface MapParametersProvider
Parameters:
fromMap - the map to copy parameters from

size

public int size()
Description copied from interface: ParametersProvider
Returns the number of parameters in this parameters provider. This is the size of the map returned by getAll method.

Specified by:
size in interface ParametersProvider

getAll

public java.util.Map<java.lang.String,java.lang.String> getAll()
Description copied from interface: ParametersProvider
Allows to get map of the provided parameters. Note that get method can provide more parameters then are returned by this method. However, all the parameters returned by this method should also be available via get method.

Specified by:
getAll in interface ParametersProvider
Returns:
copy of the backed data

toString

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