Configuration
Configuration is used for storing and manipulating configuration data.
Summary
| public final class Configuration | |
|---|---|
| Defines the Configuration Java class | |
| Methods | |
| getValue | |
| setValue | |
| hasValue | |
| removeValue | |
| parse | |
| read | |
| reset | |
Methods
getValue()
Retrieves the value associated with the specified configuration key.
| public native Object getValue(String key) |
|---|
| Parameters |
key: String — The key whose value is to be retrieved. |
| Return Value |
Object — The value associated with the key, or null if not found. |
setValue()
Sets the value for the specified configuration key.
| public native void setValue(String key, Object value) |
|---|
| Parameters |
key: String — The key for which to set the value. |
value: Object — The value to assign to the key. |
| Return Value |
| none |
hasValue()
Checks whether a value exists for the specified configuration key.
| public native boolean hasValue(String key) |
|---|
| Parameters |
key: String — The key to check for existence of a value. |
| Return Value |
boolean — true if a value exists, otherwise false. |
removeValue()
Removes the value associated with the specified configuration key.
| public native boolean removeValue(String key) |
|---|
| Parameters |
key: String — The key whose value is to be removed. |
| Return Value |
boolean — true if the value was removed, otherwise false. |
parse()
Parses configuration data from a JSON string.
| public native void parse(String JSON) |
|---|
| Parameters |
JSON: String — The JSON string containing configuration data. |
| Return Value |
| none |
read()
Reads configuration data from the specified file.
| public native void read(String filename) |
|---|
| Parameters |
filename: String — The name of the file to read configuration data from. |
| Return Value |
| none |
reset()
Resets all configuration data to defaults.
| public native void reset() |
|---|
| Return Value |
| none |