jetbrains.buildServer.parameters.impl
Class AliasParametersProvider

java.lang.Object
  extended by jetbrains.buildServer.parameters.impl.AliasParametersProvider
All Implemented Interfaces:
MapParametersProvider, ParametersProvider

public class AliasParametersProvider
extends java.lang.Object
implements MapParametersProvider

Allows to find a parameter by both its original key and alias key.

Author:
Yegor.Yarko Date: 09.06.2008

Constructor Summary
AliasParametersProvider(MapParametersProvider source)
           
 
Method Summary
 void addAlias(java.lang.String alias, java.lang.String originalName)
           
 java.lang.String get(java.lang.String key)
           
 java.util.Map<java.lang.String,java.lang.String> getAll()
          Returns a copy of the source map.
 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

AliasParametersProvider

public AliasParametersProvider(MapParametersProvider source)
Method Detail

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()
Returns a copy of the source map. Note that the aliased values are not included.

Specified by:
getAll in interface ParametersProvider
Returns:

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:
value from the backed map corresponding to the key, or (if not found) corresponding to alias of the key.

put

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

remove

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

putAll

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

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

addAlias

public void addAlias(java.lang.String alias,
                     java.lang.String originalName)

toString

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