类 NacosEnvs


  • public class NacosEnvs
    extends java.lang.Object
    environment utils.
    作者:
    onewe
    • 构造器概要

      构造器 
      构造器 说明
      NacosEnvs()  
    • 方法概要

      所有方法 静态方法 具体方法 
      修饰符和类型 方法 说明
      static java.lang.Boolean getBoolean​(java.lang.String key)
      get boolean, if the value can not be got by the special key, the null will be returned.
      static java.lang.Boolean getBoolean​(java.lang.String key, java.lang.Boolean defaultValue)
      get boolean, if the value can not be got by the special key, the default value will be returned.
      static java.lang.Integer getInteger​(java.lang.String key)
      get integer, if the value can not be got by the special key, the null will be returned.
      static java.lang.Integer getInteger​(java.lang.String key, java.lang.Integer defaultValue)
      get integer, if the value can not be got by the special key, the default value will be returned.
      static java.lang.Long getLong​(java.lang.String key)
      get long, if the value can not be got by the special key, the null will be returned.
      static java.lang.Long getLong​(java.lang.String key, java.lang.Long defaultValue)
      get long, if the value can not be got by the special key, the default value will be returned.
      static java.lang.String getProperty​(java.lang.String key)
      get property, if the value can not be got by the special key, the null will be returned.
      static java.lang.String getProperty​(java.lang.String key, java.lang.String defaultValue)  
      static void init​(java.util.Properties properties)
      init environment.
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • NacosEnvs

        public NacosEnvs()
    • 方法详细资料

      • init

        public static void init​(java.util.Properties properties)
        init environment.
        参数:
        properties - properties
      • getProperty

        public static java.lang.String getProperty​(java.lang.String key,
                                                   java.lang.String defaultValue)
      • getProperty

        public static java.lang.String getProperty​(java.lang.String key)
        get property, if the value can not be got by the special key, the null will be returned.
        参数:
        key - special key
        返回:
        string value or null.
      • getBoolean

        public static java.lang.Boolean getBoolean​(java.lang.String key)
        get boolean, if the value can not be got by the special key, the null will be returned.
        参数:
        key - special key
        返回:
        boolean value or null.
      • getBoolean

        public static java.lang.Boolean getBoolean​(java.lang.String key,
                                                   java.lang.Boolean defaultValue)
        get boolean, if the value can not be got by the special key, the default value will be returned.
        参数:
        key - special key
        defaultValue - default value
        返回:
        boolean value or defaultValue.
      • getInteger

        public static java.lang.Integer getInteger​(java.lang.String key)
        get integer, if the value can not be got by the special key, the null will be returned.
        参数:
        key - special key
        返回:
        integer value or null
      • getInteger

        public static java.lang.Integer getInteger​(java.lang.String key,
                                                   java.lang.Integer defaultValue)
        get integer, if the value can not be got by the special key, the default value will be returned.
        参数:
        key - special key
        defaultValue - default value
        返回:
        integer value or default value
      • getLong

        public static java.lang.Long getLong​(java.lang.String key)
        get long, if the value can not be got by the special key, the null will be returned.
        参数:
        key - special key
        返回:
        long value or null
      • getLong

        public static java.lang.Long getLong​(java.lang.String key,
                                             java.lang.Long defaultValue)
        get long, if the value can not be got by the special key, the default value will be returned.
        参数:
        key - special key
        defaultValue - default value
        返回:
        long value or default value