Interface PreferencesHandler


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

      • PROPS_BASE_NAME

        static final java.lang.String PROPS_BASE_NAME
      • PROP_APP_NAME

        static final java.lang.String PROP_APP_NAME
      • PROP_SUPPRESS_CONSOLE

        static final java.lang.String PROP_SUPPRESS_CONSOLE
        Suppress any console output. @since 3.2-ALPHA-21
      • 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

      • 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 the main 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 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