Class Settings
- java.lang.Object
-
- com.realtime.crossfire.jxclient.settings.Settings
-
public class Settings extends java.lang.ObjectMaintains a set of key/value pairs. The values are stored in a flat file.
-
-
Constructor Summary
Constructors Constructor Description Settings(@NotNull java.nio.file.Path file)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangetBoolean(@NotNull SettingsEntry<java.lang.Boolean> key)Returns the boolean associated with the specified key at a node ordefaultValueif there is no association for this key.intgetInt(@NotNull SettingsEntry<java.lang.Integer> key)Returns the integer associated with the specified key at a node ordefaultValueif there is no association for this key.longgetLong(@NotNull SettingsEntry<java.lang.Long> key)Returns the long associated with the specified key at a node ordefaultValueif there is no association for this key.@NotNull java.lang.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<java.lang.Boolean> key, boolean value)Stores a key/value pair.voidputInt(@NotNull SettingsEntry<java.lang.Integer> key, int value)Stores a key/value pair.voidputLong(@NotNull SettingsEntry<java.lang.Long> key, long value)Stores a key/value pair.voidputString(@NotNull SettingsEntry<?> key, @NotNull java.lang.String value)Stores a key/value pair.voidremove(@NotNull java.lang.String key)Removes a key.
-
-
-
Method Detail
-
getString
@NotNull public @NotNull java.lang.String getString(@NotNull @NotNull SettingsEntry<?> key)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
public boolean getBoolean(@NotNull @NotNull SettingsEntry<java.lang.Boolean> key)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
public int getInt(@NotNull @NotNull SettingsEntry<java.lang.Integer> key)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
public long getLong(@NotNull @NotNull SettingsEntry<java.lang.Long> key)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
public void putString(@NotNull @NotNull SettingsEntry<?> key, @NotNull @NotNull java.lang.String value)Stores a key/value pair.- Parameters:
key- the key to storevalue- the value to store
-
putBoolean
public void putBoolean(@NotNull @NotNull SettingsEntry<java.lang.Boolean> key, boolean value)Stores a key/value pair.- Parameters:
key- the key to storevalue- the value to store
-
putInt
public void putInt(@NotNull @NotNull SettingsEntry<java.lang.Integer> key, int value)Stores a key/value pair.- Parameters:
key- the key to storevalue- the value to store
-
putLong
public void putLong(@NotNull @NotNull SettingsEntry<java.lang.Long> key, long value)Stores a key/value pair.- Parameters:
key- the key to storevalue- the value to store
-
remove
public void remove(@NotNull @NotNull java.lang.String key)Removes a key. Does nothing if the key has no associated value.- Parameters:
key- the key to remove
-
-