public abstract class Config<E extends ConfigKey> extends DestroyableBase
Base class for XxConfig
Destroyable.Util| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<ConfigKey,java.lang.Object> |
data |
protected java.util.Map<java.lang.String,java.lang.Object> |
raw |
logger| Constructor and Description |
|---|
Config() |
Config(java.util.Map<java.lang.String,?> configuration)
Construct a
AppConfig with a map. |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
get(ConfigKey key)
Return configuration by
configuration key |
<T> T |
get(java.lang.String key)
Look up configuration by a
String |
<T> T |
getIgnoreCase(java.lang.String key) |
java.lang.Integer |
getInteger(ConfigKey key) |
<T> java.util.List<T> |
getList(AppConfigKey key,
java.lang.Class<T> c)
Return a configuration value as list
|
protected abstract ConfigKey |
keyOf(java.lang.String s) |
java.util.Map |
rawConfiguration() |
protected void |
releaseResources() |
java.util.Map |
subSet(java.lang.String prefix) |
addSubResource, destroy, isDestroyed, reload, scopedebug, debug, error, error, fatal, fatal, info, info, isDebugEnabled, isTraceEnabled, trace, trace, warn, warnprotected java.util.Map<java.lang.String,java.lang.Object> raw
protected java.util.Map<ConfigKey,java.lang.Object> data
public Config(java.util.Map<java.lang.String,?> configuration)
Construct a AppConfig with a map. The map is copied to the original map of the configuration instance
configuration - public Config()
protected void releaseResources()
releaseResources in class DestroyableBasepublic <T> T get(ConfigKey key)
Return configuration by configuration key
T - key - public java.lang.Integer getInteger(ConfigKey key)
public <T> java.util.List<T> getList(AppConfigKey key, java.lang.Class<T> c)
Return a configuration value as list
T - key - c - public <T> T get(java.lang.String key)
Look up configuration by a String key. If the String key can be converted into rythm configuration key, then it is converted and call to get(ConfigKey) method. Otherwise the original configuration map is used to fetch the value from the string key
T - key - public <T> T getIgnoreCase(java.lang.String key)
public java.util.Map rawConfiguration()
public java.util.Map subSet(java.lang.String prefix)
protected abstract ConfigKey keyOf(java.lang.String s)
Copyright © 2014–2017 ActFramework. All rights reserved.