接口 NacosClientProperties

  • 所有已知实现类:
    SearchableProperties

    public interface NacosClientProperties
    NacosClientProperties interface. include all the properties from jvm args, system environment, default setting. more details you can see https://github.com/alibaba/nacos/issues/8622
    作者:
    onewe
    • 字段概要

      字段 
      修饰符和类型 字段 说明
      static NacosClientProperties PROTOTYPE
      all the NacosClientProperties object must be created by PROTOTYPE, so child NacosClientProperties can read properties from the PROTOTYPE.
    • 方法概要

      所有方法 实例方法 抽象方法 
      修饰符和类型 方法 说明
      void addProperties​(java.util.Properties properties)
      add properties.
      java.util.Properties asProperties()
      get properties from NacosClientProperties.
      boolean containsKey​(java.lang.String key)
      Tests if the specified object is a key in this NacosClientProperties.
      NacosClientProperties derive()
      create a new NacosClientProperties which scope is itself.
      NacosClientProperties derive​(java.util.Properties properties)
      create a new NacosClientProperties from NacosClientProperties#PROTOTYPE and init.
      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.
      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.
      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.
      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.
      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.
      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.
      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.
      java.lang.String getProperty​(java.lang.String key, java.lang.String defaultValue)
      get property, if the value can not be got by the special key, the default value will be returned.
      void setProperty​(java.lang.String key, java.lang.String value)
      set property.
    • 字段详细资料

      • PROTOTYPE

        static final NacosClientProperties PROTOTYPE
        all the NacosClientProperties object must be created by PROTOTYPE, so child NacosClientProperties can read properties from the PROTOTYPE. it looks like this: |-PROTOTYPE----------------> ip=127.0.0.1 |---|-child1---------------> port=6379 if you search key called "port" from child1, certainly you will get 6379 if you search key called "ip" from child1, you will get 127.0.0.1. because the child can read properties from parent NacosClientProperties
    • 方法详细资料

      • getProperty

        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.
      • getProperty

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

        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

        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

        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

        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

        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

        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
      • setProperty

        void setProperty​(java.lang.String key,
                         java.lang.String value)
        set property.
        参数:
        key - key
        value - value
      • addProperties

        void addProperties​(java.util.Properties properties)
        add properties.
        参数:
        properties - properties
      • containsKey

        boolean containsKey​(java.lang.String key)
        Tests if the specified object is a key in this NacosClientProperties.
        参数:
        key - key – possible key
        返回:
        true if and only if the specified object is a key in this NacosClientProperties, false otherwise.
      • asProperties

        java.util.Properties asProperties()
        get properties from NacosClientProperties.
        返回:
        properties
      • derive

        NacosClientProperties derive()
        create a new NacosClientProperties which scope is itself.
        返回:
        NacosClientProperties
      • derive

        NacosClientProperties derive​(java.util.Properties properties)
        create a new NacosClientProperties from NacosClientProperties#PROTOTYPE and init.
        参数:
        properties - properties
        返回:
        NacosClientProperties