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
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumProperty convention. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe 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 aLinkedHashMapof configuration from an array of values.static PropertySourceCreate aPropertySourcefrom the given map.static PropertySourceCreate aPropertySourcefrom the given map.static PropertySourceCreate aPropertySourcefrom the given map.static PropertySourceCreate aPropertySourcefrom the given map.static PropertySourceCreate aPropertySourcenamedEnvironment.DEFAULT_NAMEfrom 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 aPropertySourcefrom 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 aPropertySourcefrom 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 aPropertySourcefrom 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 aLinkedHashMapof configuration from an array of values.- Parameters:
values- The values- Returns:
- The created map
- Since:
- 2.0
-
of
Create aPropertySourcefrom the given map.- Parameters:
name- The name of the property sourcemap- The mappriority- The priority to order by- Returns:
- The
PropertySource
-
of
Create aPropertySourcenamedEnvironment.DEFAULT_NAMEfrom the given map.- Parameters:
map- The map- Returns:
- The
PropertySource
-