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