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 interfaceThe origin of the property source.static 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()default @NonNull PropertySource.OriginCreate aLinkedHashMapof configuration from an array of values.static PropertySourceDeprecated, for removal: This API element is subject to removal in a future version.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 PropertySourceDeprecated, for removal: This API element is subject to removal in a future version.static PropertySourceof(String name, Map<String, Object> map, PropertySource.PropertyConvention convention, PropertySource.Origin origin) Create 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
-
getOrigin
- Returns:
- The origin of the property source.
- Since:
- 4.8.0
-
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
Create aPropertySourcefrom the given map.- Parameters:
name- The name of the property sourcemap- The maporigin- The origin- Returns:
- The
PropertySource
-
of
@Deprecated(forRemoval=true, since="4.8.0") static PropertySource of(String name, Map<String, Object> map, PropertySource.PropertyConvention convention) Deprecated, for removal: This API element is subject to removal in a future version.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
static PropertySource of(String name, Map<String, Object> map, PropertySource.PropertyConvention convention, PropertySource.Origin origin) Create aPropertySourcefrom the given map.- Parameters:
name- The name of the property sourcemap- The mapconvention- The convention type of the property sourceorigin- The origin- Returns:
- The
PropertySource
-
of
Deprecated, for removal: This API element is subject to removal in a future version.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
static PropertySource of(String name, Map<String, Object> map, PropertySource.Origin origin, int priority) Create aPropertySourcefrom the given map.- Parameters:
name- The name of the property sourcemap- The maporigin- The originpriority- The priority to order by- Returns:
- The
PropertySource - Since:
- 4.8.0
-
of
Create aPropertySourcenamedEnvironment.DEFAULT_NAMEfrom the given map.- Parameters:
map- The map- Returns:
- The
PropertySource
-
of(String, Map, Origin)