|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造函数 | 方法 | 详细信息: 字段 | 构造函数 | 方法 | |||||||||
public interface Configuration
Configuration interface. The general idea here is to make something that will work like our extended properties and be compatible with the preferences API if at all possible.
| 方法摘要 | |
|---|---|
void |
addProperty(java.lang.String key,
java.lang.Object value)
Add a property to the configuration. |
void |
clearProperty(java.lang.String key)
Clear a property in the configuration. |
boolean |
containsKey(java.lang.String key)
Check if the configuration contains the key. |
boolean |
getBoolean(java.lang.String key)
Get a boolean associated with the given configuration key. |
boolean |
getBoolean(java.lang.String key,
boolean defaultValue)
Get a boolean associated with the given configuration key. |
java.lang.Boolean |
getBoolean(java.lang.String key,
java.lang.Boolean defaultValue)
Get a boolean associated with the given configuration key. |
byte |
getByte(java.lang.String key)
Get a byte associated with the given configuration key. |
byte |
getByte(java.lang.String key,
byte defaultValue)
Get a byte associated with the given configuration key. |
java.lang.Byte |
getByte(java.lang.String key,
java.lang.Byte defaultValue)
Get a byte associated with the given configuration key. |
double |
getDouble(java.lang.String key)
Get a double associated with the given configuration key. |
double |
getDouble(java.lang.String key,
double defaultValue)
Get a double associated with the given configuration key. |
java.lang.Double |
getDouble(java.lang.String key,
java.lang.Double defaultValue)
Get a double associated with the given configuration key. |
float |
getFloat(java.lang.String key)
Get a float associated with the given configuration key. |
float |
getFloat(java.lang.String key,
float defaultValue)
Get a float associated with the given configuration key. |
java.lang.Float |
getFloat(java.lang.String key,
java.lang.Float defaultValue)
Get a float associated with the given configuration key. |
int |
getInt(java.lang.String key)
Get a int associated with the given configuration key. |
int |
getInt(java.lang.String key,
int defaultValue)
Get a int associated with the given configuration key. |
java.lang.Integer |
getInteger(java.lang.String key,
java.lang.Integer defaultValue)
Get a int associated with the given configuration key. |
java.util.Iterator |
getKeys()
Get the list of the keys contained in the configuration repository. |
java.util.Iterator |
getKeys(java.lang.String prefix)
Get the list of the keys contained in the configuration repository that match the specified prefix. |
long |
getLong(java.lang.String key)
Get a long associated with the given configuration key. |
long |
getLong(java.lang.String key,
long defaultValue)
Get a long associated with the given configuration key. |
java.lang.Long |
getLong(java.lang.String key,
java.lang.Long defaultValue)
Get a long associated with the given configuration key. |
java.util.Properties |
getProperties(java.lang.String key)
Get a list of properties associated with the given configuration key. |
java.lang.Object |
getProperty(java.lang.String key)
Gets a property from the configuration. |
short |
getShort(java.lang.String key)
Get a short associated with the given configuration key. |
short |
getShort(java.lang.String key,
short defaultValue)
Get a short associated with the given configuration key. |
java.lang.Short |
getShort(java.lang.String key,
java.lang.Short defaultValue)
Get a short associated with the given configuration key. |
java.lang.String |
getString(java.lang.String key)
Get a string associated with the given configuration key. |
java.lang.String |
getString(java.lang.String key,
java.lang.String defaultValue)
Get a string associated with the given configuration key. |
java.lang.String[] |
getStringArray(java.lang.String key)
Get an array of strings associated with the given configuration key. |
java.util.Vector |
getVector(java.lang.String key)
Get a Vector of strings associated with the given configuration key. |
java.util.Vector |
getVector(java.lang.String key,
java.util.Vector defaultValue)
Get a Vector of strings associated with the given configuration key. |
boolean |
isEmpty()
Check if the configuration is empty. |
void |
setProperty(java.lang.String key,
java.lang.Object value)
Set a property, this will replace any previously set values. |
Configuration |
subset(java.lang.String prefix)
Create an Configuration object that is a subset of this one. |
| 方法详细信息 |
|---|
Configuration subset(java.lang.String prefix)
prefix - The prefix used to select the properties.boolean isEmpty()
boolean containsKey(java.lang.String key)
void addProperty(java.lang.String key,
java.lang.Object value)
key - The Key to add the property to.value - The Value to add.
void setProperty(java.lang.String key,
java.lang.Object value)
key - The key of the property to changevalue - The new valuevoid clearProperty(java.lang.String key)
key - the key to remove along with corresponding value.java.lang.Object getProperty(java.lang.String key)
key - property to retrieve
java.util.Iterator getKeys(java.lang.String prefix)
prefix - The prefix to test against.
java.util.Iterator getKeys()
java.util.Properties getProperties(java.lang.String key)
key - The configuration key.
java.lang.ClassCastException - is thrown if the key maps to an
object that is not a String/Vector.
java.lang.IllegalArgumentException - if one of the tokens is
malformed (does not contain an equals sign).boolean getBoolean(java.lang.String key)
key - The configuration key.
java.util.NoSuchElementException - is thrown if the key doesn't
map to an existing object.
java.lang.ClassCastException - is thrown if the key maps to an
object that is not a Boolean.
boolean getBoolean(java.lang.String key,
boolean defaultValue)
key - The configuration key.defaultValue - The default value.
java.lang.ClassCastException - is thrown if the key maps to an
object that is not a Boolean.
java.lang.Boolean getBoolean(java.lang.String key,
java.lang.Boolean defaultValue)
key - The configuration key.defaultValue - The default value.
java.lang.ClassCastException - is thrown if the key maps to an
object that is not a Boolean.byte getByte(java.lang.String key)
key - The configuration key.
java.util.NoSuchElementException - is thrown if the key doesn't
map to an existing object.
java.lang.ClassCastException - is thrown if the key maps to an
object that is not a Byte.
java.lang.NumberFormatException - is thrown if the value mapped
by the key has not a valid number format.
byte getByte(java.lang.String key,
byte defaultValue)
key - The configuration key.defaultValue - The default value.
java.lang.ClassCastException - is thrown if the key maps to an
object that is not a Byte.
java.lang.NumberFormatException - is thrown if the value mapped
by the key has not a valid number format.
java.lang.Byte getByte(java.lang.String key,
java.lang.Byte defaultValue)
key - The configuration key.defaultValue - The default value.
java.lang.ClassCastException - is thrown if the key maps to an object that
is not a Byte.
java.lang.NumberFormatException - is thrown if the value mapped by the key
has not a valid number format.double getDouble(java.lang.String key)
key - The configuration key.
java.util.NoSuchElementException - is thrown if the key doesn't
map to an existing object.
java.lang.ClassCastException - is thrown if the key maps to an
object that is not a Double.
java.lang.NumberFormatException - is thrown if the value mapped
by the key has not a valid number format.
double getDouble(java.lang.String key,
double defaultValue)
key - The configuration key.defaultValue - The default value.
java.lang.ClassCastException - is thrown if the key maps to an
object that is not a Double.
java.lang.NumberFormatException - is thrown if the value mapped
by the key has not a valid number format.
java.lang.Double getDouble(java.lang.String key,
java.lang.Double defaultValue)
key - The configuration key.defaultValue - The default value.
java.lang.ClassCastException - is thrown if the key maps to an
object that is not a Double.
java.lang.NumberFormatException - is thrown if the value mapped
by the key has not a valid number format.float getFloat(java.lang.String key)
key - The configuration key.
java.util.NoSuchElementException - is thrown if the key doesn't
map to an existing object.
java.lang.ClassCastException - is thrown if the key maps to an
object that is not a Float.
java.lang.NumberFormatException - is thrown if the value mapped
by the key has not a valid number format.
float getFloat(java.lang.String key,
float defaultValue)
key - The configuration key.defaultValue - The default value.
java.lang.ClassCastException - is thrown if the key maps to an
object that is not a Float.
java.lang.NumberFormatException - is thrown if the value mapped
by the key has not a valid number format.
java.lang.Float getFloat(java.lang.String key,
java.lang.Float defaultValue)
key - The configuration key.defaultValue - The default value.
java.lang.ClassCastException - is thrown if the key maps to an
object that is not a Float.
java.lang.NumberFormatException - is thrown if the value mapped
by the key has not a valid number format.int getInt(java.lang.String key)
key - The configuration key.
java.util.NoSuchElementException - is thrown if the key doesn't
map to an existing object.
java.lang.ClassCastException - is thrown if the key maps to an
object that is not a Integer.
java.lang.NumberFormatException - is thrown if the value mapped
by the key has not a valid number format.
int getInt(java.lang.String key,
int defaultValue)
key - The configuration key.defaultValue - The default value.
java.lang.ClassCastException - is thrown if the key maps to an
object that is not a Integer.
java.lang.NumberFormatException - is thrown if the value mapped
by the key has not a valid number format.
java.lang.Integer getInteger(java.lang.String key,
java.lang.Integer defaultValue)
key - The configuration key.defaultValue - The default value.
java.lang.ClassCastException - is thrown if the key maps to an object that
is not a Integer.
java.lang.NumberFormatException - is thrown if the value mapped by the key
has not a valid number format.long getLong(java.lang.String key)
key - The configuration key.
java.util.NoSuchElementException - is thrown if the key doesn't
map to an existing object.
java.lang.ClassCastException - is thrown if the key maps to an
object that is not a Long.
java.lang.NumberFormatException - is thrown if the value mapped
by the key has not a valid number format.
long getLong(java.lang.String key,
long defaultValue)
key - The configuration key.defaultValue - The default value.
java.lang.ClassCastException - is thrown if the key maps to an
object that is not a Long.
java.lang.NumberFormatException - is thrown if the value mapped
by the key has not a valid number format.
java.lang.Long getLong(java.lang.String key,
java.lang.Long defaultValue)
key - The configuration key.defaultValue - The default value.
java.lang.ClassCastException - is thrown if the key maps to an
object that is not a Long.
java.lang.NumberFormatException - is thrown if the value mapped
by the key has not a valid number format.short getShort(java.lang.String key)
key - The configuration key.
java.util.NoSuchElementException - is thrown if the key doesn't
map to an existing object.
java.lang.ClassCastException - is thrown if the key maps to an
object that is not a Short.
java.lang.NumberFormatException - is thrown if the value mapped
by the key has not a valid number format.
short getShort(java.lang.String key,
short defaultValue)
key - The configuration key.defaultValue - The default value.
java.lang.ClassCastException - is thrown if the key maps to an
object that is not a Short.
java.lang.NumberFormatException - is thrown if the value mapped
by the key has not a valid number format.
java.lang.Short getShort(java.lang.String key,
java.lang.Short defaultValue)
key - The configuration key.defaultValue - The default value.
java.lang.ClassCastException - is thrown if the key maps to an
object that is not a Short.
java.lang.NumberFormatException - is thrown if the value mapped
by the key has not a valid number format.
java.util.NoSuchElementException - is thrown if the key doesn't
map to an existing object.java.lang.String getString(java.lang.String key)
key - The configuration key.
java.lang.ClassCastException - is thrown if the key maps to an object that
is not a String.
java.util.NoSuchElementException - is thrown if the key doesn't
map to an existing object.
java.lang.String getString(java.lang.String key,
java.lang.String defaultValue)
key - The configuration key.defaultValue - The default value.
java.lang.ClassCastException - is thrown if the key maps to an object that
is not a String.java.lang.String[] getStringArray(java.lang.String key)
key - The configuration key.
java.lang.ClassCastException - is thrown if the key maps to an
object that is not a String/Vector of Strings.java.util.Vector getVector(java.lang.String key)
key - The configuration key.
java.lang.ClassCastException - is thrown if the key maps to an
object that is not a Vector.
java.util.Vector getVector(java.lang.String key,
java.util.Vector defaultValue)
key - The configuration key.defaultValue - The default value.
java.lang.ClassCastException - is thrown if the key maps to an
object that is not a Vector.
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造函数 | 方法 | 详细信息: 字段 | 构造函数 | 方法 | |||||||||