Package org.forgerock.config.resolvers
Class ChainedPropertyResolver
- java.lang.Object
-
- org.forgerock.config.resolvers.ChainedPropertyResolver
-
- All Implemented Interfaces:
PropertyResolver
public class ChainedPropertyResolver extends Object implements PropertyResolver
Contains a chain ofPropertyResolver
s that should be used to get a token replacement property. When constructing the chain thePropertyResolver
s should be listed in the order they should be checked for a given property.
-
-
Constructor Summary
Constructors Constructor Description ChainedPropertyResolver(List<? extends PropertyResolver> resolvers)
Creates a chained property resolver given a list ofPropertyResolver
s.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<String>
getProperty(String key, boolean sensitive)
Returns the value of the specified property.static ChainedPropertyResolver
of(PropertyResolver... resolvers)
Constructs aChainedPropertyResolver
given a a list ofPropertyResolver
s.String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.forgerock.config.resolvers.PropertyResolver
getProperty, getProperty, getProperty
-
-
-
-
Constructor Detail
-
ChainedPropertyResolver
public ChainedPropertyResolver(List<? extends PropertyResolver> resolvers)
Creates a chained property resolver given a list ofPropertyResolver
s.- Parameters:
resolvers
- the list of @link PropertyResolver}s. This list should be in the order you want thePropertyResolver
s to be evaluated.
-
-
Method Detail
-
getProperty
public Optional<String> getProperty(String key, boolean sensitive)
Description copied from interface:PropertyResolver
Returns the value of the specified property. The method returns an emptyOptional
if the property is not found. The resolved property has to be considered sensitive ifsensitive
istrue
and implementations are required to handle it with special attention (no logs, ...).- Specified by:
getProperty
in interfacePropertyResolver
- Parameters:
key
- The name of the requested property. The key can't be null.sensitive
-true
is the property value has to be considered a sensitive value (such as a password).- Returns:
- An
Optional
string that contains the value of the requested property, or emptyOptional
if property is undefined.
-
of
public static ChainedPropertyResolver of(PropertyResolver... resolvers)
Constructs aChainedPropertyResolver
given a a list ofPropertyResolver
s. A property will attempt to be resolved in the order that thePropertyResolver
s are defined.- Parameters:
resolvers
- The list of the resolvers in the order that a property will be resolved.- Returns:
- a
ChainedPropertyResolver
-
-