public abstract class AbstractConfigSource extends java.lang.Object implements IConfigSource
IConfigSource
.Constructor and Description |
---|
AbstractConfigSource() |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(java.lang.String key)
Check if the given key can be found in the config.
|
boolean |
get(java.lang.String key,
boolean defaultValue)
Get a boolean associated with the given configuration key.
|
java.lang.Class<?> |
get(java.lang.String key,
java.lang.Class<?> defaultValue)
Get a Class associated with the given configuration key.
|
double |
get(java.lang.String key,
double defaultValue)
Get a double associated with the given configuration key.
|
float |
get(java.lang.String key,
float defaultValue)
Get a float associated with the given configuration key.
|
int |
get(java.lang.String key,
int defaultValue)
Get a int associated with the given configuration key.
|
long |
get(java.lang.String key,
long defaultValue)
Get a long associated with the given configuration key.
|
java.lang.String |
get(java.lang.String key,
java.lang.String defaultValue)
Get a String associated with the given configuration key.
|
<T extends java.lang.Enum<T>> |
get(java.lang.String key,
T defaultValue)
Get a Enum associated with the given configuration key.
|
protected java.lang.String |
getAsgName() |
java.util.List<java.lang.String> |
getList(java.lang.String prop)
Get a list of strings associated with the given configuration key.
|
java.util.List<java.lang.String> |
getList(java.lang.String prop,
java.util.List<java.lang.String> defaultValue)
Get a list of strings associated with the given configuration key.
|
protected java.lang.String |
getRegion() |
void |
intialize(java.lang.String asgName,
java.lang.String region)
Must be called before any other method.
|
boolean |
isEmpty()
Returns
true if the size is zero. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
get, set, size
public void intialize(java.lang.String asgName, java.lang.String region)
IConfigSource
intialize
in interface IConfigSource
public boolean contains(java.lang.String key)
IConfigSource
contains
in interface IConfigSource
key
- to look up value.public boolean isEmpty()
IConfigSource
true
if the size is zero. May be more efficient than calculating size.isEmpty
in interface IConfigSource
true
if the size is zero otherwise false
.public java.lang.String get(java.lang.String key, java.lang.String defaultValue)
IConfigSource
get
in interface IConfigSource
key
- to look up value.defaultValue
- if value is not present.public boolean get(java.lang.String key, boolean defaultValue)
IConfigSource
get
in interface IConfigSource
key
- to look up value.defaultValue
- if value is not present.public java.lang.Class<?> get(java.lang.String key, java.lang.Class<?> defaultValue)
IConfigSource
get
in interface IConfigSource
key
- to look up value.defaultValue
- if value is not present.public <T extends java.lang.Enum<T>> T get(java.lang.String key, T defaultValue)
IConfigSource
get
in interface IConfigSource
T
- enum type.key
- to look up value.defaultValue
- if value is not present.public int get(java.lang.String key, int defaultValue)
IConfigSource
get
in interface IConfigSource
key
- to look up value.defaultValue
- if value is not present.public long get(java.lang.String key, long defaultValue)
IConfigSource
get
in interface IConfigSource
key
- to look up value.defaultValue
- if value is not present.public float get(java.lang.String key, float defaultValue)
IConfigSource
get
in interface IConfigSource
key
- to look up value.defaultValue
- if value is not present.public double get(java.lang.String key, double defaultValue)
IConfigSource
get
in interface IConfigSource
key
- to look up value.defaultValue
- if value is not present.public java.util.List<java.lang.String> getList(java.lang.String prop)
IConfigSource
getList
in interface IConfigSource
prop
- to look up value.public java.util.List<java.lang.String> getList(java.lang.String prop, java.util.List<java.lang.String> defaultValue)
IConfigSource
getList
in interface IConfigSource
prop
- to look up value.defaultValue
- if value is not present.protected java.lang.String getAsgName()
protected java.lang.String getRegion()