Interface PreferencesHandler


public interface PreferencesHandler
Since:
3.2-ALPHA-17
Author:
Fabrizio Giudici
  • Field Details

    • PROPS_BASE_NAME

      static final String PROPS_BASE_NAME
    • PROP_APP_NAME

      static final String PROP_APP_NAME
    • PROP_SUPPRESS_CONSOLE

      static final String PROP_SUPPRESS_CONSOLE
      Suppress any console output. @since 3.2-ALPHA-21
    • __BASE_NAME

      static final String __BASE_NAME
      See Also:
    • KEY_INITIAL_SIZE

      static final Key<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<Boolean> KEY_FULL_SCREEN
      Whether the application should start at full screen.
  • Method Details

    • getInstance

      @Nonnull static PreferencesHandler getInstance()
    • getAppFolder

      @Nonnull Path getAppFolder()
    • getLogFolder

      @Nonnull Path getLogFolder()
    • setAppName

      static void setAppName(@Nonnull String name)
      Sets the application name. This method must be called at boot from the main method before doing anything else.
      Parameters:
      name - the property name
    • getProperty

      @Nonnull <T> 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 name
      value - 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 name
      value - the property value