Interface ThemeOption<T>

Type Parameters:
T - the value type of the option

public interface ThemeOption<T>
Defines a dynamic theme option.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    Represents a typed key for identifying a theme option.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Applies this option change to a scene.
    @Nullable T
    Returns the default value for this option.
    key()
    Returns the unique key of this option.
    static <T> ThemeOption<T>
    of(ThemeOption.Key<T> key, @Nullable T defaultValue, Consumer<ThemeManager.Change<T>> handler)
    Creates a theme option instance.
  • Method Details

    • key

      Returns the unique key of this option.
    • defaultValue

      @Nullable T defaultValue()
      Returns the default value for this option.
    • apply

      void apply(ThemeManager.Change<T> change)
      Applies this option change to a scene.
    • of

      static <T> ThemeOption<T> of(ThemeOption.Key<T> key, @Nullable T defaultValue, Consumer<ThemeManager.Change<T>> handler)
      Creates a theme option instance.
      Type Parameters:
      T - the value type
      Parameters:
      key - the option key
      defaultValue - default value of the option
      handler - action that applies the option