Package org.forgerock.config.resolvers
Interface PropertyResolver
-
- All Known Implementing Classes:
ChainedPropertyResolver
,EnvironmentVariableResolver
,FileContentResolver
,FlatFileResolver
,JsonValueResolver
,ProductPathResolver
,PropertiesResolver
,SystemPropertyResolver
public interface PropertyResolver
A property resolver attempt to get the value of a given config property.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default Optional<String>
getProperty(String key)
Deprecated.In favour ofgetProperty(String, boolean)
Optional<String>
getProperty(String key, boolean sensitive)
Returns the value of the specified property.default Optional<String>
getProperty(String key, String defaultValue)
Deprecated.In favour ofgetProperty(String, String, boolean)
default Optional<String>
getProperty(String key, String defaultValue, boolean sensitive)
Returns the value of the specified property.
-
-
-
Method Detail
-
getProperty
@Deprecated default Optional<String> getProperty(String key)
Deprecated.In favour ofgetProperty(String, boolean)
Returns the value of the specified property. The method returns an emptyOptional
if the property is not found. The resolved property is considered as sensitive and will not appear in logs.- Parameters:
key
- The name of the requested property. The key can't be null.- Returns:
- An
Optional
string that contains the value of the requested property, or emptyOptional
if property is undefined. - Throws:
NullPointerException
- if key is null.
-
getProperty
Optional<String> getProperty(String key, boolean sensitive)
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, ...).- 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. - Throws:
NullPointerException
- if key is null.
-
getProperty
@Deprecated default Optional<String> getProperty(String key, String defaultValue)
Deprecated.In favour ofgetProperty(String, String, boolean)
Returns the value of the specified property. The method returns an emptyOptional
if the property is not found and there is no default value provided. The resolved property is considered as sensitive and will not appear in logs.- Parameters:
key
- The name of the requested property. The key can't be null.defaultValue
- The default value if the property is not defined.- Returns:
- An
Optional
string that contains the value of the requested property, or emptyOptional
if property is undefined and a default is not supplied. - Throws:
NullPointerException
- if key is null.
-
getProperty
default Optional<String> getProperty(String key, String defaultValue, boolean sensitive)
Returns the value of the specified property. The method returns an emptyOptional
if the property is not found and there is no default value provided. The resolved property has to be considered sensitive ifsensitive
istrue
and implementations are required to handle it with special attention (no logs, ...).- Parameters:
key
- The name of the requested property. The key can't be null.defaultValue
- The default value if the property is not defined.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 and a default is not supplied. - Throws:
NullPointerException
- if key is null.
-
-