Class Configuration
java.lang.Object
ece.ing3.java.projet.configuration.Configuration
Configuration helper.
Offers a convenient way to get and set configuration parameters.
- Author:
- Virgile, Nicolas, Louis-Félix
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Preferencesget()Returns the underlying Preferences instance.static StringGet a configuration String value by key.static StringGet a configuration String value by key.static PathGets the application's data storage path for the current user.static voidinit()Loads the configuration.static voidsave()Saves the configuration.static voidSets a configuration value.
-
Constructor Details
-
Configuration
public Configuration()
-
-
Method Details
-
init
public static void init()Loads the configuration. -
get
Returns the underlying Preferences instance.- Returns:
- Preferences instance
-
save
Saves the configuration.- Throws:
BackingStoreException- Error while saving.
-
getString
Get a configuration String value by key.- Parameters:
key- Configuration key- Returns:
- Value
-
getString
Get a configuration String value by key.- Parameters:
key- Configuration keydefaultValue- Default value- Returns:
- Value
-
set
Sets a configuration value.- Parameters:
key- Configuration keyvalue- Value
-
getUserDataPath
Gets the application's data storage path for the current user.- Returns:
- Application data storage path or
nullon error
-