@Configuration public class EnvironmentConfig extends Object implements org.springframework.context.EnvironmentAware
| Constructor and Description |
|---|
EnvironmentConfig() |
| Modifier and Type | Method and Description |
|---|---|
static Boolean |
getBoolean(String key,
Boolean defaultValue)
获取布尔型配置属性值
|
static Double |
getDouble(String key,
Double defaultValue)
获取双精度浮点型配置属性值
|
static Float |
getFloat(String key,
Float defaultValue)
获取浮点型配置属性值
|
static Integer |
getInteger(String key,
Integer defaultValue)
获取整性配置属性值
|
static String |
getProperty(String key)
获取属性
|
static String |
getProperty(String key,
String defaultValue)
获取配置属性值
|
void |
setEnvironment(org.springframework.core.env.Environment env) |
public void setEnvironment(org.springframework.core.env.Environment env)
setEnvironment in interface org.springframework.context.EnvironmentAwarepublic static String getProperty(String key, String defaultValue)
key - 属性keydefaultValue - 属性默认值public static Integer getInteger(String key, Integer defaultValue)
key - 属性keydefaultValue - 属性默认值public static Boolean getBoolean(String key, Boolean defaultValue)
key - 属性keydefaultValue - 属性默认值public static Float getFloat(String key, Float defaultValue)
key - 属性keydefaultValue - 属性默认值Copyright © 2025. All rights reserved.