Package cn.dreamfame.core.launch.props
Class DreamProperties
java.lang.Object
cn.dreamfame.core.launch.props.DreamProperties
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.context.EnvironmentAware,org.springframework.core.env.EnvironmentCapable
@ConfigurationProperties("dream")
public class DreamProperties
extends Object
implements org.springframework.context.EnvironmentAware, org.springframework.core.env.EnvironmentCapable
- Author:
- dreamfame
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsKey(String key) 判断是否存在key获取配置获取配置getBoolean(String key) 获取配置getBoolean(String key, Boolean defaultValue) 获取配置获取配置获取配置org.springframework.core.env.Environment获取配置获取配置获取配置获取配置voidsetEnvironment(org.springframework.core.env.Environment environment)
-
Field Details
-
environment
@Nullable private org.springframework.core.env.Environment environment -
env
开发环境 -
name
服务名 -
isLocal
判断是否为 本地开发环境 -
prop
装载自定义配置dream.prop.xxx
-
-
Constructor Details
-
DreamProperties
public DreamProperties()
-
-
Method Details
-
get
获取配置- Parameters:
key- key- Returns:
- value
-
get
获取配置- Parameters:
key- keydefaultValue- 默认值- Returns:
- value
-
getInt
获取配置- Parameters:
key- key- Returns:
- int value
-
getInt
获取配置- Parameters:
key- keydefaultValue- 默认值- Returns:
- int value
-
getLong
获取配置- Parameters:
key- key- Returns:
- long value
-
getLong
获取配置- Parameters:
key- keydefaultValue- 默认值- Returns:
- long value
-
getBoolean
获取配置- Parameters:
key- key- Returns:
- Boolean value
-
getBoolean
获取配置- Parameters:
key- keydefaultValue- 默认值- Returns:
- Boolean value
-
getDouble
获取配置- Parameters:
key- key- Returns:
- double value
-
getDouble
获取配置- Parameters:
key- keydefaultValue- 默认值- Returns:
- double value
-
containsKey
判断是否存在key- Parameters:
key- prop key- Returns:
- boolean
-
setEnvironment
public void setEnvironment(org.springframework.core.env.Environment environment) - Specified by:
setEnvironmentin interfaceorg.springframework.context.EnvironmentAware
-
getEnvironment
public org.springframework.core.env.Environment getEnvironment()- Specified by:
getEnvironmentin interfaceorg.springframework.core.env.EnvironmentCapable
-