接口 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 final NacosClientPropertiesall 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 -
方法概要
修饰符和类型方法说明voidaddProperties(Properties properties) add properties.get properties from NacosClientProperties.booleancontainsKey(String key) Tests if the specified object is a key in this NacosClientProperties.derive()create a new NacosClientProperties which scope is itself.derive(Properties properties) create a new NacosClientProperties from NacosClientProperties#PROTOTYPE and init.getBoolean(String key) 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.getInteger(String key) 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.get long, if the value can not be got by the special key, the default value will be returned.getProperties(SourceType source) get property from special property source.getProperty(String key) 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.getPropertyFrom(SourceType source, String key) get property from special property source.voidsetProperty(String key, String value) set property.
-
字段详细资料
-
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
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
get property, if the value can not be got by the special key, the default value will be returned.- 参数:
key- special keydefaultValue- default value- 返回:
- string value or default value.
-
getPropertyFrom
get property from special property source.- 参数:
source- source typekey- special key- 返回:
- string value or null.
- 另请参阅:
-
getProperties
get property from special property source.- 参数:
source- source type- 返回:
- string value or null.
- 另请参阅:
-
getBoolean
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
get boolean, if the value can not be got by the special key, the default value will be returned.- 参数:
key- special keydefaultValue- default value- 返回:
- boolean value or defaultValue.
-
getInteger
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
get integer, if the value can not be got by the special key, the default value will be returned.- 参数:
key- special keydefaultValue- default value- 返回:
- integer value or default value
-
getLong
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
get long, if the value can not be got by the special key, the default value will be returned.- 参数:
key- special keydefaultValue- default value- 返回:
- long value or default value
-
setProperty
set property.- 参数:
key- keyvalue- value
-
addProperties
add properties.- 参数:
properties- properties
-
containsKey
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
NacosClientProperties derive()create a new NacosClientProperties which scope is itself.- 返回:
- NacosClientProperties
-
derive
create a new NacosClientProperties from NacosClientProperties#PROTOTYPE and init.- 参数:
properties- properties- 返回:
- NacosClientProperties
-