Package be.panako.util
Class Config
java.lang.Object
be.panako.util.Config
Writes and read the configuration values to and from a properties file.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringstatic booleangetBoolean(Key key) static floatstatic Configstatic intstatic StringgetPreference(String key) Use preferences to store configuration that changes during runtime and need to be persisted.readPreference(String preferenceKey) static voidSets a configuration value to use during the runtime of the application.static voidsetPreference(String key, String value) Use preferences to store configuration that changes during runtime and need to be persisted.voidwritePreference(String preferenceKey, String value)
-
Constructor Details
-
Config
public Config()Hidden default constructor. Reads the configured values, or stores the defaults.
-
-
Method Details
-
writePreference
-
readPreference
-
getInstance
-
get
-
getInt
-
getFloat
-
getBoolean
-
set
Sets a configuration value to use during the runtime of the application. These configuration values are not persisted. To- Parameters:
key- The key to set.value- The value to use.
-
setPreference
Use preferences to store configuration that changes during runtime and need to be persisted.- Parameters:
key- The key to store.value- The value to store
-
getPreference
Use preferences to store configuration that changes during runtime and need to be persisted.- Parameters:
key- The key to store.- Returns:
- The configured preference value.
-