Package io.micronaut.context.env
Interface PropertySource
- All Known Implementing Classes:
CommandLinePropertySource
,EmptyPropertySource
,EnvironmentPropertySource
,KubernetesEnvironmentPropertySource
,MapPropertySource
,SystemPropertiesPropertySource
A PropertySource is a location to resolve property values from. The property keys are available via the
Iterable.iterator()
method.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Property convention. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The name of the property source with values supplied directly from the context.Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Method Summary
Modifier and TypeMethodDescriptionGet a property value of the given key.getName()
Create aLinkedHashMap
of configuration from an array of values.static PropertySource
Create aPropertySource
from the given map.static PropertySource
Create aPropertySource
from the given map.static PropertySource
Create aPropertySource
from the given map.static PropertySource
Create aPropertySource
from the given map.static PropertySource
Create aPropertySource
namedEnvironment.DEFAULT_NAME
from the given map.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Field Details
-
CONTEXT
The name of the property source with values supplied directly from the context.- See Also:
-
-
Method Details
-
getName
String getName()- Returns:
- The name of the property source
-
get
Get a property value of the given key.- Parameters:
key
- The key- Returns:
- The value
-
getConvention
- Returns:
- Whether the property source has upper case underscore separated keys
-
of
Create aPropertySource
from the given map.- Parameters:
name
- The name of the property sourcemap
- The map- Returns:
- The
PropertySource
-
of
static PropertySource of(String name, Map<String, Object> map, PropertySource.PropertyConvention convention) Create aPropertySource
from the given map.- Parameters:
name
- The name of the property sourcemap
- The mapconvention
- The convention type of the property source- Returns:
- The
PropertySource
-
of
Create aPropertySource
from the given map.- Parameters:
name
- The name of the property sourcevalues
- The values as an array of alternating key/value entries- Returns:
- The
PropertySource
- Since:
- 2.0
-
mapOf
Create aLinkedHashMap
of configuration from an array of values.- Parameters:
values
- The values- Returns:
- The created map
- Since:
- 2.0
-
of
Create aPropertySource
from the given map.- Parameters:
name
- The name of the property sourcemap
- The mappriority
- The priority to order by- Returns:
- The
PropertySource
-
of
Create aPropertySource
namedEnvironment.DEFAULT_NAME
from the given map.- Parameters:
map
- The map- Returns:
- The
PropertySource
-