jetbrains.buildServer.parameters.impl
Class CompositeParametersProviderImpl

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

public class CompositeParametersProviderImpl
extends java.lang.Object
implements CompositeParametersProvider

Simple CompositeParametersProvider implementation

Author:
Yegor.Yarko Date: 06.06.2008

Field Summary
protected  java.util.List<ParametersProvider> myProviders
           
 
Constructor Summary
CompositeParametersProviderImpl()
           
 
Method Summary
 void appendParametersProvider(ParametersProvider provider)
          Appends a provider to the end of providers list.
 java.lang.String get(java.lang.String key)
          Looks up a value corresponding to the key passed.
 java.util.Map<java.lang.String,java.lang.String> getAll()
          Allows to get map of the provided parameters.
 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
 

Field Detail

myProviders

protected java.util.List<ParametersProvider> myProviders
Constructor Detail

CompositeParametersProviderImpl

public CompositeParametersProviderImpl()
Method Detail

appendParametersProvider

public void appendParametersProvider(@NotNull
                                     ParametersProvider provider)
Appends a provider to the end of providers list. Note that the values in the providers appended earlier will take precedence.

Specified by:
appendParametersProvider in interface CompositeParametersProvider
Parameters:
provider - the provider to append

get

@Nullable
public java.lang.String get(@NotNull
                                     java.lang.String key)
Looks up a value corresponding to the key passed. The providers are looked up in the order they were appended. So, if the key occurs in two providers, the one appended earlier will be used to get the value.

Specified by:
get in interface ParametersProvider
Parameters:
key -
Returns:
the value corresponding to the key passed from the first matching held provider

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:
the map which has the same key-value pairs as the the provider

toString

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