- All Implemented Interfaces:
Map<String,String>
Map
implementation adapting an
Environment
object in order to use the
Environment
as a
Map
.
- Since:
- 1.3.1
- See Also:
-
-
Nested Class Summary
Nested Classes
-
Constructor Summary
Constructors
-
Method Summary
boolean
Null-safe method determining whether the given
key
is a property
in the underlying
Environment
.
from(org.springframework.core.env.Environment environment)
Factory method used to construct an new instance of
EnvironmentMapAdapter
initialized with
the given
Environment
.
Gets the
value
for the property identified by the given
Map
key
from the underlying
Environment
.
protected org.springframework.core.env.Environment
Gets the configured
Environment
object being adapted by this
Map
.
Methods inherited from class java.util.AbstractMap
clear, clone, containsValue, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, toString, values
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
EnvironmentMapAdapter
public EnvironmentMapAdapter(@NonNull
org.springframework.core.env.Environment environment)
- Parameters:
environment
- Environment
to adapt; must not be null.
- Throws:
IllegalArgumentException
- if Environment
is null.
- See Also:
-
-
Method Details
-
-
getEnvironment
@NonNull
protected org.springframework.core.env.Environment getEnvironment()
Gets the configured
Environment
object being adapted by this
Map
.
- Returns:
- the configured
Environment
; never null.
- See Also:
-
-
containsKey
public boolean containsKey(@Nullable
Object key)
Null-safe method determining whether the given
key
is a property
in the underlying
Environment
.
- Specified by:
containsKey
in interface Map<String,String>
- Overrides:
containsKey
in class AbstractMap<String,String>
- Returns:
- a boolean value indicating whether the given
key
is a property
in the underlying Environment
.
- See Also:
-
-
get
Gets the
value
for the property identified by the given
Map
key
from the underlying
Environment
.
- Specified by:
get
in interface Map<String,String>
- Overrides:
get
in class AbstractMap<String,String>
- Parameters:
key
- key
identifying the property whose value will be retrieved from the Environment
.
- Returns:
- the
value
of the property identified by the given Map
key
from the Environment
.
- See Also:
-
-
entrySet
- Specified by:
entrySet
in interface Map<String,String>
- Specified by:
entrySet
in class AbstractMap<String,String>