public interface Configuration
Modifier and Type | Method and Description |
---|---|
default boolean |
booleanValue(java.lang.String key,
boolean defaultValue)
Returns the boolean value for the required key.
|
Runtime |
getRuntime()
Returns the target runtime for optimizations.
|
default boolean |
isFeatureEnabled(java.lang.String featureId)
Returns true if a particular optimizer is enabled, independently
of the runtime.
|
java.lang.String |
mandatoryValue(java.lang.String key)
Returns the value of the configuration for the requested
key or fails if not available.
|
default java.lang.String |
optionalString(java.lang.String key,
java.lang.String defaultValue)
Returns the string for the specified configuration key, or the
default value when missing.
|
<T> T |
optionalValue(java.lang.String key,
java.util.function.Function<java.util.Optional<java.lang.String>,T> producer)
Returns the value for the requested key.
|
default java.util.List<java.lang.String> |
stringList(java.lang.String key)
Returns a list of strings from a configuration entry.
|
default java.util.List<java.lang.String> |
stringList(java.lang.String key,
java.lang.String separator)
Returns a list of strings from a configuration entry.
|
@NonNull java.lang.String mandatoryValue(java.lang.String key)
key
- the key to look for@Nullable <T> T optionalValue(java.lang.String key, java.util.function.Function<java.util.Optional<java.lang.String>,T> producer)
T
- the type of the return valuekey
- the configuration keyproducer
- a function called to generate a transformed value@Nullable default java.lang.String optionalString(@NonNull java.lang.String key, @Nullable java.lang.String defaultValue)
key
- the keydefaultValue
- the default value@NonNull default java.util.List<java.lang.String> stringList(@NonNull java.lang.String key)
key
- the configuration key@NonNull default java.util.List<java.lang.String> stringList(@NonNull java.lang.String key, @NonNull java.lang.String separator)
key
- the key to look forseparator
- a separator regular expressiondefault boolean booleanValue(@NonNull java.lang.String key, boolean defaultValue)
key
- the key to look fordefaultValue
- the default value when missingdefault boolean isFeatureEnabled(@NonNull java.lang.String featureId)
featureId
- the feature id@NonNull Runtime getRuntime()