Package io.micronaut.context.env
Class MapPropertySource
java.lang.Object
io.micronaut.context.env.MapPropertySource
- All Implemented Interfaces:
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 io.micronaut.context.env.PropertySource
PropertySource.PropertyConvention -
Field Summary
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCEFields inherited from interface io.micronaut.context.env.PropertySource
CONTEXT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasMap()The backing map (unmodifiable).Get a property value of the given key.getName()iterator()static MapPropertySourceCreate a newMapPropertySourcefrom the given map.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface io.micronaut.core.order.Ordered
getOrderMethods inherited from interface io.micronaut.context.env.PropertySource
getConvention
-
Constructor Details
-
MapPropertySource
Creates a map property source.- Parameters:
name- The name of the property sourcemap- The map
-
-
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
The backing map (unmodifiable).- Returns:
- The backing map
-
of
Create a newMapPropertySourcefrom the given map.- Parameters:
name- The name of the property sourcemap- The map- Returns:
- The map property source
-
toString
-