public interface NacosClientProperties
| 限定符和类型 | 字段和说明 |
|---|---|
static 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
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addProperties(Properties properties)
add properties.
|
Properties |
asProperties()
get properties from NacosClientProperties.
|
boolean |
containsKey(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(Properties properties)
create a new NacosClientProperties from NacosClientProperties#PROTOTYPE and init.
|
Boolean |
getBoolean(String key)
get boolean, if the value can not be got by the special key, the null will be returned.
|
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.
|
Integer |
getInteger(String key)
get integer, if the value can not be got by the special key, the null will be returned.
|
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.
|
Long |
getLong(String key)
get long, if the value can not be got by the special key, the null will be returned.
|
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.
|
Properties |
getProperties(SourceType source)
get property from special property source.
|
String |
getProperty(String key)
get property, if the value can not be got by the special key, the null will be returned.
|
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.
|
String |
getPropertyFrom(SourceType source,
String key)
get property from special property source.
|
void |
setProperty(String key,
String value)
set property.
|
static final NacosClientProperties PROTOTYPE
String getProperty(String key)
key - special keyString getProperty(String key, String defaultValue)
key - special keydefaultValue - default valueString getPropertyFrom(SourceType source, String key)
source - source typekey - special keySourceTypeProperties getProperties(SourceType source)
source - source typeSourceTypeBoolean getBoolean(String key)
key - special keyBoolean getBoolean(String key, Boolean defaultValue)
key - special keydefaultValue - default valueInteger getInteger(String key)
key - special keyInteger getInteger(String key, Integer defaultValue)
key - special keydefaultValue - default valueLong getLong(String key)
key - special keyLong getLong(String key, Long defaultValue)
key - special keydefaultValue - default valuevoid addProperties(Properties properties)
properties - propertiesboolean containsKey(String key)
key - key – possible keyProperties asProperties()
NacosClientProperties derive()
NacosClientProperties derive(Properties properties)
properties - propertiesCopyright © 2018–2024 Alibaba Group. All rights reserved.