Class CompositeParametersProviderImpl
- java.lang.Object
-
- jetbrains.buildServer.parameters.impl.CompositeParametersProviderImpl
-
- All Implemented Interfaces:
CompositeParametersProvider,ContainsAwareParametersProvider,ParametersProvider
- Direct Known Subclasses:
DepParametersMemoryOptimizedProvider
public class CompositeParametersProviderImpl extends Object implements CompositeParametersProvider, ContainsAwareParametersProvider
Simple CompositeParametersProvider implementation- Author:
- Yegor.Yarko Date: 06.06.2008
-
-
Field Summary
Fields Modifier and Type Field Description protected List<ParametersProvider>myProviders
-
Constructor Summary
Constructors Constructor Description CompositeParametersProviderImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendParametersProvider(ParametersProvider provider)Appends a provider to the end of providers list.booleancontains(String key)Returns true if this parameters provider contains specified keyStringget(String key)Looks up a value corresponding to the key passed.Map<String,String>getAll()Allows to get map of the provided parameters.intsize()Returns the number of parameters in this parameters provider.StringtoString()
-
-
-
Field Detail
-
myProviders
protected List<ParametersProvider> myProviders
-
-
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:
appendParametersProviderin interfaceCompositeParametersProvider- Parameters:
provider- the provider to append
-
get
@Nullable public String get(@NotNull 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:
getin interfaceParametersProvider- Parameters:
key- key to look for- Returns:
- the value corresponding to the key passed from the first matching held provider
-
contains
public boolean contains(@NotNull String key)Description copied from interface:ContainsAwareParametersProviderReturns true if this parameters provider contains specified key- Specified by:
containsin interfaceContainsAwareParametersProvider- Parameters:
key- key of interest- Returns:
- see above
-
size
public int size()
Description copied from interface:ParametersProviderReturns the number of parameters in this parameters provider. This is the size of the map returned by getAll method.- Specified by:
sizein interfaceParametersProvider
-
getAll
public Map<String,String> getAll()
Description copied from interface:ParametersProviderAllows 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:
getAllin interfaceParametersProvider- Returns:
- the map which has the same key-value pairs as the the provider
-
-