Package io.micronaut.context.env
Class EnvironmentPropertySource
java.lang.Object
io.micronaut.context.env.MapPropertySource
io.micronaut.context.env.EnvironmentPropertySource
- All Implemented Interfaces:
PropertySource
,Ordered
,Iterable<String>
Loads properties from environment variables via
System.getenv()
.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.micronaut.context.env.PropertySource
PropertySource.PropertyConvention
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Constant for Environment property source.static final int
The position of the loader.Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Fields inherited from interface io.micronaut.context.env.PropertySource
CONTEXT
-
Constructor Summary
ConstructorDescriptionDefault constructor.Allows for control over which environment variables are included. -
Method Summary
Methods inherited from class io.micronaut.context.env.MapPropertySource
asMap, get, getName, iterator, of, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
POSITION
public static final int POSITIONThe position of the loader.- See Also:
-
NAME
Constant for Environment property source.- See Also:
-
-
Constructor Details
-
EnvironmentPropertySource
public EnvironmentPropertySource()Default constructor. -
EnvironmentPropertySource
public EnvironmentPropertySource(@Nullable @Nullable List<String> includes, @Nullable @Nullable List<String> excludes) Allows for control over which environment variables are included.- Parameters:
includes
- The environment variables to include in configurationexcludes
- The environment variables to exclude from configuration
-
-
Method Details
-
getOrder
public int getOrder()- Returns:
- The order of the object. Defaults to zero (no order).
-
getConvention
- Returns:
- Whether the property source has upper case underscore separated keys
-