Package it.tidalwave.util
Interface PreferencesHandler
public interface PreferencesHandler
- Since:
- 3.2-ALPHA-17
- Author:
- Fabrizio Giudici
-
Nested Class Summary
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the path of the folder where files related to the app should go.static PreferencesHandler
Returns a singleton instance.Returns the path of the folder where logs should go.<T> Optional
<T> getProperty
(Key<T> name) Gets a property.static void
setAppName
(String name) Sets the application name.<T> void
setDefaultProperty
(Key<T> name, T value) Sets a property, unless it has been already set.<T> void
setProperty
(Key<T> name, T value) Sets a property, overriding the current value.
-
Field Details
-
PROPS_BASE_NAME
-
PROP_APP_NAME
-
PROP_SUPPRESS_CONSOLE
Suppress any console output. @since 3.2-ALPHA-21
-
-
Method Details
-
getInstance
Returns a singleton instance.- Returns:
- the singleton instance
-
getAppFolder
Returns the path of the folder where files related to the app should go.- Returns:
- the path
-
getLogFolder
Returns the path of the folder where logs should go.- Returns:
- the path
-
setAppName
Sets the application name. This method must be called at boot from themain
method before doing anything else.- Parameters:
name
- the property name
-
getProperty
Gets a property.- Type Parameters:
T
- the property type- Parameters:
name
- the property name- Returns:
- the property value
-
setProperty
Sets a property, overriding the current value.- Type Parameters:
T
- the property type- Parameters:
name
- the property namevalue
- the property value
-
setDefaultProperty
Sets a property, unless it has been already set.- Type Parameters:
T
- the property type- Parameters:
name
- the property namevalue
- the property value
-