public interface PreferencesHandler
- Since:
- 3.2-ALPHA-17
- Author:
- Fabrizio Giudici
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionReturns the path of the folder where files related to the app should go.static PreferencesHandlerReturns a singleton instance.Returns the path of the folder where logs should go.<T> Optional<T> getProperty(Key<T> name) Gets a property.static voidsetAppName(String name) Sets the application name.<T> voidsetDefaultProperty(Key<T> name, T value) Sets a property, unless it has been already set.<T> voidsetProperty(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 themainmethod 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
-