Package it.tidalwave.util
Interface PreferencesHandler
-
public interface PreferencesHandler
- Since:
- 3.2-ALPHA-17
- Author:
- Fabrizio Giudici
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
PreferencesHandler.Inner
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
__BASE_NAME
static Key<java.lang.Boolean>
KEY_FULL_SCREEN
Whether the application should start at full screen.static Key<java.lang.Double>
KEY_INITIAL_SIZE
A property representing the initial main window size as a percentual of the screen size.static java.lang.String
PROP_APP_NAME
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description java.nio.file.Path
getAppFolder()
static PreferencesHandler
getInstance()
java.nio.file.Path
getLogFolder()
<T> java.util.Optional<T>
getProperty(Key<T> name)
Gets a property.static void
setAppName(java.lang.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 Detail
-
PROP_APP_NAME
static final java.lang.String PROP_APP_NAME
-
__BASE_NAME
static final java.lang.String __BASE_NAME
- See Also:
- Constant Field Values
-
KEY_INITIAL_SIZE
static final Key<java.lang.Double> KEY_INITIAL_SIZE
A property representing the initial main window size as a percentual of the screen size.
-
KEY_FULL_SCREEN
static final Key<java.lang.Boolean> KEY_FULL_SCREEN
Whether the application should start at full screen.
-
-
Method Detail
-
getInstance
@Nonnull static PreferencesHandler getInstance()
-
getAppFolder
@Nonnull java.nio.file.Path getAppFolder()
-
getLogFolder
@Nonnull java.nio.file.Path getLogFolder()
-
setAppName
static void setAppName(@Nonnull java.lang.String name)
Sets the application name. This method must be called at boot from themain
method before doing anything else.- Parameters:
name
- the property name
-
getProperty
@Nonnull <T> java.util.Optional<T> getProperty(@Nonnull Key<T> name)
Gets a property.- Type Parameters:
T
- the property type- Parameters:
name
- the property name- Returns:
- the property value
-
setProperty
<T> void setProperty(@Nonnull Key<T> name, @Nonnull T value)
Sets a property, overriding the current value.- Type Parameters:
T
- the property type- Parameters:
name
- the property namevalue
- the property value
-
setDefaultProperty
<T> void setDefaultProperty(@Nonnull Key<T> name, @Nonnull T value)
Sets a property, unless it has been already set.- Type Parameters:
T
- the property type- Parameters:
name
- the property namevalue
- the property value
-
-