public class OneProperties extends Object
| 限定符 | 构造器和说明 |
|---|---|
protected |
OneProperties() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected String |
getConfig(IConfigKey key)
Get config string.
|
protected String |
getConfig(String keyPrefix,
IConfigKey key)
Get config string.
|
protected BigDecimal |
getDecimalConfig(IConfigKey key)
Get config decimal value.
|
protected BigDecimal |
getDecimalConfig(String keyPrefix,
IConfigKey key)
Get config decimal value.
|
protected boolean |
isConfigTrue(IConfigKey key)
Get config bool value.
|
protected boolean |
isConfigTrue(String keyPrefix,
IConfigKey key)
Get config bool value.
|
protected void |
loadConfigs()
Load properties.
|
protected void |
modifyConfig(IConfigKey key,
String value)
Modify one config and write new config into properties file.
|
protected void |
modifyConfig(Map<IConfigKey,String> modifyConfig)
Modify configs and write new configs into properties file.
|
protected void |
modifyConfig(String keyPrefix,
IConfigKey key,
String value)
Modify one config and write new config into properties file.
|
protected void loadConfigs()
protected String getConfig(IConfigKey key)
Get config string.
If not config will return null.key - config keyprotected String getConfig(String keyPrefix, IConfigKey key)
Get config string. Config key with prefix.
If not config will return null.keyPrefix - config key prefixkey - config keyprotected boolean isConfigTrue(IConfigKey key)
Get config bool value. For true/false config.
If not config will return false.key - config keyprotected boolean isConfigTrue(String keyPrefix, IConfigKey key)
Get config bool value. For true/false config. Config key with prefix.
If not config will return false.keyPrefix - config key prefixkey - config keyprotected BigDecimal getDecimalConfig(IConfigKey key)
Get config decimal value. For all number config.
If not config will return null.key - config keyBigDecimalprotected BigDecimal getDecimalConfig(String keyPrefix, IConfigKey key)
Get config decimal value. For all number config. Config key with prefix.
If not config will return null.keyPrefix - config key prefixkey - config keyBigDecimalprotected void modifyConfig(IConfigKey key, String value) throws IOException
key - need update config keyvalue - new valueIOExceptionprotected void modifyConfig(String keyPrefix, IConfigKey key, String value) throws IOException
keyPrefix - config key prefixkey - need update config keyvalue - new valueIOExceptionprotected void modifyConfig(Map<IConfigKey,String> modifyConfig) throws IOException
Modify configs and write new configs into properties file.
If new config value is null, will not update old value.modifyConfig - need update config map.IOExceptionCopyright © 2015. All rights reserved.