public class DefaultEnvironmentConfigPropertyProvider extends Object implements EnvironmentConfigPropertyProvider
ConfigPropertyProvider using Spring context Environment as configuration property source.| Constructor and Description |
|---|
DefaultEnvironmentConfigPropertyProvider(org.springframework.core.env.Environment environment)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsProperty(String key)
Return whether the given property key is available, i.e.
|
org.springframework.core.env.Environment |
getEnvironment()
Gets the Spring context Environment
|
<T> T |
getProperty(String key,
Class<T> targetType)
Return the property value associated with the given key and try to convert property value to given target type.
|
Stream<String> |
getPropertyNames()
Returns a Stream of all available property names
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateprefixed, using, using, using, using, using, usingSystemPropertiespublic DefaultEnvironmentConfigPropertyProvider(org.springframework.core.env.Environment environment)
environment - Spring context Environment (not null)public org.springframework.core.env.Environment getEnvironment()
getEnvironment in interface EnvironmentConfigPropertyProviderpublic boolean containsProperty(String key)
ConfigPropertyProvidernull.containsProperty in interface ConfigPropertyProviderkey - Property key (not null)true if property exists and has not null valuepublic <T> T getProperty(String key, Class<T> targetType) throws IllegalArgumentException
ConfigPropertyProvidergetProperty in interface ConfigPropertyProviderT - Expected property and result typekey - the property name to resolve (not null)targetType - the expected type of the property valuenull if the key cannot be resolvedIllegalArgumentException - If property value cannot be converted to target typepublic Stream<String> getPropertyNames() throws UnsupportedOperationException
ConfigPropertyProvidergetPropertyNames in interface ConfigPropertyProviderUnsupportedOperationException - If this operation is not supported by concrete implementationCopyright © 2019 The Holon Platform. All rights reserved.