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 Preferences
get()
Returns the underlying Preferences instance.static String
Get a configuration String value by key.static String
Get a configuration String value by key.static Path
Gets the application's data storage path for the current user.static void
init()
Loads the configuration.static void
save()
Saves the configuration.static void
Sets 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
null
on error
-