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 Details

    • environment

      @Nullable private org.springframework.core.env.Environment environment
    • env

      private String env
      开发环境
    • name

      private String name
      服务名
    • isLocal

      private Boolean isLocal
      判断是否为 本地开发环境
    • prop

      private final Map<String,String> prop
      装载自定义配置dream.prop.xxx
  • Constructor Details

    • DreamProperties

      public DreamProperties()
  • Method Details

    • get

      @Nullable public String get(String key)
      获取配置
      Parameters:
      key - key
      Returns:
      value
    • get

      @Nullable public String get(String key, @Nullable String defaultValue)
      获取配置
      Parameters:
      key - key
      defaultValue - 默认值
      Returns:
      value
    • getInt

      @Nullable public Integer getInt(String key)
      获取配置
      Parameters:
      key - key
      Returns:
      int value
    • getInt

      @Nullable public Integer getInt(String key, @Nullable Integer defaultValue)
      获取配置
      Parameters:
      key - key
      defaultValue - 默认值
      Returns:
      int value
    • getLong

      @Nullable public Long getLong(String key)
      获取配置
      Parameters:
      key - key
      Returns:
      long value
    • getLong

      @Nullable public Long getLong(String key, @Nullable Long defaultValue)
      获取配置
      Parameters:
      key - key
      defaultValue - 默认值
      Returns:
      long value
    • getBoolean

      @Nullable public Boolean getBoolean(String key)
      获取配置
      Parameters:
      key - key
      Returns:
      Boolean value
    • getBoolean

      @Nullable public Boolean getBoolean(String key, @Nullable Boolean defaultValue)
      获取配置
      Parameters:
      key - key
      defaultValue - 默认值
      Returns:
      Boolean value
    • getDouble

      @Nullable public Double getDouble(String key)
      获取配置
      Parameters:
      key - key
      Returns:
      double value
    • getDouble

      @Nullable public Double getDouble(String key, @Nullable Double defaultValue)
      获取配置
      Parameters:
      key - key
      defaultValue - 默认值
      Returns:
      double value
    • containsKey

      public boolean containsKey(String key)
      判断是否存在key
      Parameters:
      key - prop key
      Returns:
      boolean
    • setEnvironment

      public void setEnvironment(org.springframework.core.env.Environment environment)
      Specified by:
      setEnvironment in interface org.springframework.context.EnvironmentAware
    • getEnvironment

      public org.springframework.core.env.Environment getEnvironment()
      Specified by:
      getEnvironment in interface org.springframework.core.env.EnvironmentCapable