接口 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
  • 字段概要

    字段
    修饰符和类型
    字段
    说明
    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
  • 方法概要

    修饰符和类型
    方法
    说明
    void
    add properties.
    get properties from NacosClientProperties.
    boolean
    Tests if the specified object is a key in this NacosClientProperties.
    create a new NacosClientProperties which scope is itself.
    derive(Properties properties)
    create a new NacosClientProperties from NacosClientProperties#PROTOTYPE and init.
    get boolean, if the value can not be got by the special key, the null will be returned.
    getBoolean(String key, Boolean defaultValue)
    get boolean, if the value can not be got by the special key, the default value will be returned.
    get integer, if the value can not be got by the special key, the null will be returned.
    getInteger(String key, Integer defaultValue)
    get integer, if the value can not be got by the special key, the default value will be returned.
    get long, if the value can not be got by the special key, the null will be returned.
    getLong(String key, Long defaultValue)
    get long, if the value can not be got by the special key, the default value will be returned.
    get property from special property source.
    get property, if the value can not be got by the special key, the null will be returned.
    getProperty(String key, String defaultValue)
    get property, if the value can not be got by the special key, the default value will be returned.
    get property from special property source.
    void
    setProperty(String key, 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

      String getProperty(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

      String getProperty(String key, 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.
    • getPropertyFrom

      String getPropertyFrom(SourceType source, String key)
      get property from special property source.
      参数:
      source - source type
      key - special key
      返回:
      string value or null.
      另请参阅:
    • getProperties

      Properties getProperties(SourceType source)
      get property from special property source.
      参数:
      source - source type
      返回:
      string value or null.
      另请参阅:
    • getBoolean

      Boolean getBoolean(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

      Boolean getBoolean(String key, 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

      Integer getInteger(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

      Integer getInteger(String key, 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

      Long getLong(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

      Long getLong(String key, 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(String key, String value)
      set property.
      参数:
      key - key
      value - value
    • addProperties

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

      boolean containsKey(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

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

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

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