public interface PropertySource extends Iterable<String>, Ordered
Iterable.iterator()
method.Modifier and Type | Interface and Description |
---|---|
static class |
PropertySource.PropertyConvention
Property convention.
|
Modifier and Type | Field and Description |
---|---|
static String |
CONTEXT
The name of the property source with values supplied directly from the context.
|
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Modifier and Type | Method and Description |
---|---|
Object |
get(String key)
Get a property value of the given key.
|
default PropertySource.PropertyConvention |
getConvention() |
String |
getName() |
static Map<String,Object> |
mapOf(Object... values)
Create a
LinkedHashMap of configuration from an array of values. |
static PropertySource |
of(Map<String,Object> map)
Create a
PropertySource named Environment.DEFAULT_NAME from the given map. |
static PropertySource |
of(String name,
Map<String,Object> map)
Create a
PropertySource from the given map. |
static PropertySource |
of(String name,
Map<String,Object> map,
int priority)
Create a
PropertySource from the given map. |
static PropertySource |
of(String name,
Map<String,Object> map,
PropertySource.PropertyConvention convention)
Create a
PropertySource from the given map. |
static PropertySource |
of(String name,
Object... values)
Create a
PropertySource from the given map. |
forEach, iterator, spliterator
static final String CONTEXT
String getName()
Object get(String key)
key
- The keydefault PropertySource.PropertyConvention getConvention()
static PropertySource of(String name, Map<String,Object> map)
PropertySource
from the given map.name
- The name of the property sourcemap
- The mapPropertySource
static PropertySource of(String name, Map<String,Object> map, PropertySource.PropertyConvention convention)
PropertySource
from the given map.name
- The name of the property sourcemap
- The mapconvention
- The convention type of the property sourcePropertySource
static PropertySource of(String name, Object... values)
PropertySource
from the given map.name
- The name of the property sourcevalues
- The values as an array of alternating key/value entriesPropertySource
static Map<String,Object> mapOf(Object... values)
LinkedHashMap
of configuration from an array of values.values
- The valuesstatic PropertySource of(String name, Map<String,Object> map, int priority)
PropertySource
from the given map.name
- The name of the property sourcemap
- The mappriority
- The priority to order byPropertySource
static PropertySource of(Map<String,Object> map)
PropertySource
named Environment.DEFAULT_NAME
from the given map.map
- The mapPropertySource