Class Settings
java.lang.Object
com.realtime.crossfire.jxclient.settings.Settings
Maintains a set of key/value pairs. The values are stored in a flat file.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetBoolean(@NotNull SettingsEntry<Boolean> key) Returns the boolean associated with the specified key at a node ordefaultValueif there is no association for this key.intgetInt(@NotNull SettingsEntry<Integer> key) Returns the integer associated with the specified key at a node ordefaultValueif there is no association for this key.longgetLong(@NotNull SettingsEntry<Long> key) Returns the long associated with the specified key at a node ordefaultValueif there is no association for this key.@NotNull StringgetString(@NotNull SettingsEntry<?> key) Returns the string associated with the specified key at a node, ordefaultValueif there is no association for this key.voidputBoolean(@NotNull SettingsEntry<Boolean> key, boolean value) Stores a key/value pair.voidputInt(@NotNull SettingsEntry<Integer> key, int value) Stores a key/value pair.voidputLong(@NotNull SettingsEntry<Long> key, long value) Stores a key/value pair.voidputString(@NotNull SettingsEntry<?> key, @NotNull String value) Stores a key/value pair.voidRemoves a key.
-
Constructor Details
-
Settings
Creates a new instance.- Parameters:
file- the file for loading/saving values
-
-
Method Details
-
getString
Returns the string associated with the specified key at a node, ordefaultValueif there is no association for this key.- Parameters:
key- the key to get the value for- Returns:
- the value
-
getBoolean
Returns the boolean associated with the specified key at a node ordefaultValueif there is no association for this key.- Parameters:
key- the key to get the value for- Returns:
- the value
-
getInt
Returns the integer associated with the specified key at a node ordefaultValueif there is no association for this key.- Parameters:
key- the key to get the value for- Returns:
- the value
-
getLong
Returns the long associated with the specified key at a node ordefaultValueif there is no association for this key.- Parameters:
key- the key to get the value for- Returns:
- the value
-
putString
Stores a key/value pair.- Parameters:
key- the key to storevalue- the value to store
-
putBoolean
Stores a key/value pair.- Parameters:
key- the key to storevalue- the value to store
-
putInt
Stores a key/value pair.- Parameters:
key- the key to storevalue- the value to store
-
putLong
Stores a key/value pair.- Parameters:
key- the key to storevalue- the value to store
-
remove
Removes a key. Does nothing if the key has no associated value.- Parameters:
key- the key to remove
-