Package io.micronaut.aot.core
Interface Configuration
- All Known Implementing Classes:
DefaultConfiguration
public interface Configuration
Read-only configuration for source generators.
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanbooleanValue(String key, boolean defaultValue) Returns the boolean value for the required key.booleancontainsKey(String key) Returns true if the configuration contains an entry for the specified key.Returns the target runtime for optimizations.default booleanisFeatureEnabled(String featureId) Returns true if a particular optimizer is enabled, independently of the runtime.mandatoryValue(String key) Returns the value of the configuration for the requested key or fails if not available.default StringoptionalString(String key, String defaultValue) Returns the string for the specified configuration key, or the default value when missing.<T> ToptionalValue(String key, Function<Optional<String>, T> producer) Returns the value for the requested key.stringList(String key) Returns a list of strings from a configuration entry.stringList(String key, String separator) Returns a list of strings from a configuration entry.
-
Method Details
-
containsKey
Returns true if the configuration contains an entry for the specified key.- Parameters:
key- the key to look for- Returns:
- true if the configuration contains an entry for the key
-
mandatoryValue
Returns the value of the configuration for the requested key or fails if not available.- Parameters:
key- the key to look for- Returns:
- the value for the requested key
-
optionalValue
Returns the value for the requested key.- Type Parameters:
T- the type of the return value- Parameters:
key- the configuration keyproducer- a function called to generate a transformed value- Returns:
- a configured value
-
optionalString
Returns the string for the specified configuration key, or the default value when missing.- Parameters:
key- the keydefaultValue- the default value- Returns:
- a configured string
-
stringList
Returns a list of strings from a configuration entry. The value is assumed to be of type String and will be splitted using the "," and ";" separators- Parameters:
key- the configuration key- Returns:
- a list of strings, or an empty list when missing
-
stringList
Returns a list of strings from a configuration entry. The value is assumed to be of type String and will be split. using the "," and ":" separators- Parameters:
key- the key to look forseparator- a separator regular expression- Returns:
- the list of values, or an empty list
-
booleanValue
Returns the boolean value for the required key. If the value isn't found, returns the default value- Parameters:
key- the key to look fordefaultValue- the default value when missing- Returns:
- the boolean value
-
isFeatureEnabled
Returns true if a particular optimizer is enabled, independently of the runtime. All features need to be explicitly enabled by configuration.- Parameters:
featureId- the feature id- Returns:
- true if the feature is enabled
-
getRuntime
Returns the target runtime for optimizations.- Returns:
- the target runtime
-