public class Settings
extends java.lang.Object
Constructor and Description |
---|
Settings(@NotNull java.nio.file.Path file)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getBoolean(@NotNull SettingsEntry<java.lang.Boolean> key)
Returns the boolean associated with the specified key at a node or
defaultValue if there is no association for this key. |
int |
getInt(@NotNull SettingsEntry<java.lang.Integer> key)
Returns the integer associated with the specified key at a node or
defaultValue if there is no association for this key. |
long |
getLong(@NotNull SettingsEntry<java.lang.Long> key)
Returns the long associated with the specified key at a node or
defaultValue if there is no association for this key. |
@NotNull java.lang.String |
getString(@NotNull SettingsEntry<?> key)
Returns the string associated with the specified key at a node, or
defaultValue if there is no association for this key. |
void |
putBoolean(@NotNull SettingsEntry<java.lang.Boolean> key,
boolean value)
Stores a key/value pair.
|
void |
putInt(@NotNull SettingsEntry<java.lang.Integer> key,
int value)
Stores a key/value pair.
|
void |
putLong(@NotNull SettingsEntry<java.lang.Long> key,
long value)
Stores a key/value pair.
|
void |
putString(@NotNull SettingsEntry<?> key,
@NotNull java.lang.String value)
Stores a key/value pair.
|
void |
remove(@NotNull java.lang.String key)
Removes a key.
|
public Settings(@NotNull @NotNull java.nio.file.Path file)
file
- the file for loading/saving values@NotNull public @NotNull java.lang.String getString(@NotNull @NotNull SettingsEntry<?> key)
defaultValue
if there is no association for this key.key
- the key to get the value forpublic boolean getBoolean(@NotNull @NotNull SettingsEntry<java.lang.Boolean> key)
defaultValue
if there is no association for this key.key
- the key to get the value forpublic int getInt(@NotNull @NotNull SettingsEntry<java.lang.Integer> key)
defaultValue
if there is no association for this key.key
- the key to get the value forpublic long getLong(@NotNull @NotNull SettingsEntry<java.lang.Long> key)
defaultValue
if there is no association for this key.key
- the key to get the value forpublic void putString(@NotNull @NotNull SettingsEntry<?> key, @NotNull @NotNull java.lang.String value)
key
- the key to storevalue
- the value to storepublic void putBoolean(@NotNull @NotNull SettingsEntry<java.lang.Boolean> key, boolean value)
key
- the key to storevalue
- the value to storepublic void putInt(@NotNull @NotNull SettingsEntry<java.lang.Integer> key, int value)
key
- the key to storevalue
- the value to storepublic void putLong(@NotNull @NotNull SettingsEntry<java.lang.Long> key, long value)
key
- the key to storevalue
- the value to storepublic void remove(@NotNull @NotNull java.lang.String key)
key
- the key to remove