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 ClassesModifier and TypeInterfaceDescriptionstatic final recordRepresents a typed key for identifying a theme option. -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(ThemeManager.Change<T> change) Applies this option change to a scene.@Nullable TReturns 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
ThemeOption.Key<T> key()Returns the unique key of this option. -
defaultValue
@Nullable T defaultValue()Returns the default value for this option. -
apply
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 keydefaultValue- default value of the optionhandler- action that applies the option
-