Package io.micronaut.core.util
Class EnvironmentProperties
java.lang.Object
io.micronaut.core.util.EnvironmentProperties
A mapping from environment variable names to Micronaut
property names. Those can be precomputed, or computed
on-the-fly when missing.
- Since:
- 3.2.0
-
Method Summary
Modifier and TypeMethodDescriptionasMap()
Returns an immutable view of the environment variable names to Micronaut property names cache.static EnvironmentProperties
empty()
Creates a new empty cache of environment variable names to Micronaut properties cache.Returns, for an environment variable, the list of deduced Micronaut property names.static EnvironmentProperties
fork
(EnvironmentProperties delegate) Creates a new environment properties cache which delegates queries to the delegate, but will cache values into its own cache when they are missing.static EnvironmentProperties
Creates a new environment to property names cache with the supplied set of precomputed values.
-
Method Details
-
of
Creates a new environment to property names cache with the supplied set of precomputed values.- Parameters:
preComputed
- a map from environment variable name to Micronaut property names- Returns:
- an environment properties cache
-
asMap
Returns an immutable view of the environment variable names to Micronaut property names cache.- Returns:
- the current state of the cache
-
fork
Creates a new environment properties cache which delegates queries to the delegate, but will cache values into its own cache when they are missing.- Parameters:
delegate
- the delegate- Returns:
- a new environment properties cache
-
empty
Creates a new empty cache of environment variable names to Micronaut properties cache.- Returns:
- an empty cache
-
findPropertyNamesForEnvironmentVariable
Returns, for an environment variable, the list of deduced Micronaut property names. The list is cached, so any further requests are guaranteed to return in constant time.- Parameters:
env
- the name of the environment variable- Returns:
- the list of deduced Micronaut property names
-