Class MapPropertySource
java.lang.Object
io.micronaut.context.env.MapPropertySource
- All Implemented Interfaces:
ImportCapablePropertySource, PropertySource, io.micronaut.core.order.Ordered, Iterable<String>
- Direct Known Subclasses:
CommandLinePropertySource, EnvironmentPropertySource, KubernetesEnvironmentPropertySource, SystemPropertiesPropertySource
A
PropertySource that uses a map.- Since:
- 1.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface PropertySource
PropertySource.Origin, PropertySource.PropertyConvention -
Field Summary
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCEFields inherited from interface PropertySource
CONTEXT -
Constructor Summary
ConstructorsConstructorDescriptionMapPropertySource(String name, Map<String, ?> map) Creates a map property source. -
Method Summary
Modifier and TypeMethodDescriptionasMap()The backing map (unmodifiable).@Nullable ObjectGet a property value of the given key.getName()iterator()static MapPropertySourceCreate a newMapPropertySourcefrom the given map.toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface io.micronaut.core.order.Ordered
getOrderMethods inherited from interface PropertySource
getConvention, getOrigin
-
Constructor Details
-
MapPropertySource
-
-
Method Details
-
getName
- Specified by:
getNamein interfacePropertySource- Returns:
- The name of the property source
-
get
Description copied from interface:PropertySourceGet a property value of the given key.- Specified by:
getin interfacePropertySource- Parameters:
key- The key- Returns:
- The value
-
iterator
-
asMap
-
of
Create a newMapPropertySourcefrom the given map.- Parameters:
name- The name of the property sourcemap- The map- Returns:
- The map property source
-
toString
-