@Component public class ConfigurationHelper extends Object
ConfigurationValue. Mainly used to facilitate access to current application's Environment object.| Constructor and Description |
|---|
ConfigurationHelper() |
| Modifier and Type | Method and Description |
|---|---|
Boolean |
getBooleanProperty(ConfigurationValue configurationValue)
Gets a property value as a boolean.
|
Boolean |
getBooleanProperty(ConfigurationValue configurationValue,
org.springframework.core.env.Environment environment)
Gets a property value as a boolean.
|
String |
getProperty(ConfigurationValue configurationValue)
Calls
getProperty(ConfigurationValue, Class) where the target type is String. |
<T> T |
getProperty(ConfigurationValue configurationValue,
Class<T> targetType)
|
static <T> T |
getProperty(ConfigurationValue configurationValue,
Class<T> targetType,
org.springframework.core.env.Environment environment)
Wrapper for
PropertyResolver.getProperty(String, Class, Object) using the given ConfigurationValue as the key and default value. |
static String |
getProperty(ConfigurationValue configurationValue,
org.springframework.core.env.Environment environment)
Calls
getProperty(ConfigurationValue, Class, Environment) using String targetType. |
public static String getProperty(ConfigurationValue configurationValue, org.springframework.core.env.Environment environment)
getProperty(ConfigurationValue, Class, Environment) using String targetType.configurationValue - ConfigurationValueenvironment - Environmentpublic static <T> T getProperty(ConfigurationValue configurationValue, Class<T> targetType, org.springframework.core.env.Environment environment)
PropertyResolver.getProperty(String, Class, Object) using the given ConfigurationValue as the key and default value. Optionally,
uses the configured default value if the property is not found in the environment. The configured default value must be of the same class, or must be a
sub-class of the given targetType.T - The return typeconfigurationValue - The ConfigurationValue with property key and default value.targetType - The returned object's typeenvironment - The Environment containing the propertypublic String getProperty(ConfigurationValue configurationValue)
getProperty(ConfigurationValue, Class) where the target type is String.configurationValue - ConfigurationValuepublic <T> T getProperty(ConfigurationValue configurationValue, Class<T> targetType)
configurationValue - The ConfigurationValuetargetType - The return typepublic Boolean getBooleanProperty(ConfigurationValue configurationValue)
configurationValue - the boolean configuration valuepublic Boolean getBooleanProperty(ConfigurationValue configurationValue, org.springframework.core.env.Environment environment)
configurationValue - the boolean configuration valueenvironment - the environment containing the propertyCopyright © 2017. All rights reserved.