Package com.helger.config.source.appl
Class ConfigurationSourceFunction
java.lang.Object
com.helger.config.source.AbstractConfigurationSource
com.helger.config.source.appl.ConfigurationSourceFunction
- All Implemented Interfaces:
IConfigurationSource,IConfigurationValueProvider
Default implementation of
IConfigurationSource for application based
configuration sources. The main values are provided using a custom
Function.- Author:
- Philip Helger
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConfigurationSourceFunction(int nPriority, UnaryOperator<String> aValueProvider) ConstructorConfigurationSourceFunction(UnaryOperator<String> aValueProvider) Constructor with default priority -
Method Summary
Modifier and TypeMethodDescriptionbooleangetConfigurationValue(String sKey) Get the configuration value with the provided key.final UnaryOperator<String> inthashCode()booleantoString()Methods inherited from class com.helger.config.source.AbstractConfigurationSource
getPriority, getSourceType, hasTrailingWhitespace, isSecretKey, mapToStringIgnoreSecrets
-
Field Details
-
SOURCE_TYPE
-
-
Constructor Details
-
ConfigurationSourceFunction
Constructor with default priority- Parameters:
aValueProvider- The value provider to be used. May not benull.
-
ConfigurationSourceFunction
Constructor- Parameters:
nPriority- Configuration source priority.aValueProvider- The value provider to be used. May not benull.
-
-
Method Details
-
getValueProvider
- Returns:
- The value provider as passed in the constructor. Never
null.
-
isInitializedAndUsable
public boolean isInitializedAndUsable()- Returns:
trueif the file was successfully initialized and can be used as a configuration source.
-
getConfigurationValue
Description copied from interface:IConfigurationValueProviderGet the configuration value with the provided key.- Parameters:
sKey- The key to be retrieved. May neither benullnor empty.- Returns:
nullif no such value is available.
-
equals
- Overrides:
equalsin classAbstractConfigurationSource
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractConfigurationSource
-
toString
- Overrides:
toStringin classAbstractConfigurationSource
-