Interface OptionState

All Known Subinterfaces:
OptionState.Versioned

@NonExtendable public interface OptionState
Collection of feature flags.
Since:
1.0.0
  • Method Details

    • emptyOptionState

      static OptionState emptyOptionState()
      Get an empty set of options.
      Returns:
      the empty option state
      Since:
      1.0.0
    • optionState

      @NotNull static @NotNull OptionState.Builder optionState()
      Create a builder for an unversioned option state.
      Returns:
      the builder
      Since:
      1.0.0
    • versionedOptionState

      @NotNull static @NotNull OptionState.VersionedBuilder versionedOptionState()
      Create a builder for a versioned option state.
      Returns:
      the builder
      Since:
      1.0.0
    • has

      boolean has(@NotNull @NotNull Option<?> option)
      Get whether this state contains a certain option at all.
      Parameters:
      option - the option to check.
      Returns:
      whether the option has been touched.
      Since:
      1.0.0
    • value

      <V> V value(@NotNull @NotNull Option<V> option)
      Get the value set for a certain option.
      Type Parameters:
      V - the value type
      Parameters:
      option - the option to query
      Returns:
      the option value
      Since:
      1.0.0