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 SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic interfaceThe origin of the property source.static enumProperty convention.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringThe name of the property source with values supplied directly from the context.Fields inherited from interface io.micronaut.core.order.OrderedHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
- 
Method SummaryModifier 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.IterableforEach, iterator, spliterator
- 
Field Details- 
CONTEXTThe name of the property source with values supplied directly from the context.- See Also:
 
 
- 
- 
Method Details- 
getNameString getName()- Returns:
- The name of the property source
 
- 
getGet 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
 
- 
ofCreate aPropertySourcefrom the given map.- Parameters:
- name- The name of the property source
- map- The map
- Returns:
- The PropertySource
 
- 
ofCreate aPropertySourcefrom the given map.- Parameters:
- name- The name of the property source
- map- The map
- origin- 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 source
- map- The map
- convention- The convention type of the property source
- Returns:
- The PropertySource
 
- 
ofstatic 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 source
- map- The map
- convention- The convention type of the property source
- origin- The origin
- Returns:
- The PropertySource
 
- 
ofDeprecated, 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 source
- values- The values as an array of alternating key/value entries
- Returns:
- The PropertySource
- Since:
- 2.0
 
- 
mapOfCreate aLinkedHashMapof configuration from an array of values.- Parameters:
- values- The values
- Returns:
- The created map
- Since:
- 2.0
 
- 
ofCreate aPropertySourcefrom the given map.- Parameters:
- name- The name of the property source
- map- The map
- priority- The priority to order by
- Returns:
- The PropertySource
 
- 
ofstatic 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 source
- map- The map
- origin- The origin
- priority- The priority to order by
- Returns:
- The PropertySource
- Since:
- 4.8.0
 
- 
ofCreate aPropertySourcenamedEnvironment.DEFAULT_NAMEfrom the given map.- Parameters:
- map- The map
- Returns:
- The PropertySource
 
 
- 
of(String, Map, Origin)