Interface OptionState

All Known Subinterfaces:
OptionState.Versioned

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

    • emptyOptionState

      @Deprecated static OptionState emptyOptionState()
      Deprecated.
      for removal since 1.1.0, access via OptionSchema.emptyState() instead
      Get an empty set of options.
      Returns:
      the empty option state
      Since:
      1.0.0
    • optionState

      @Deprecated static OptionState.Builder optionState()
      Deprecated.
      for removal since 1.1.0, create states via OptionSchema.stateBuilder() instead
      Create a builder for an unversioned option state.
      Returns:
      the builder
      Since:
      1.0.0
    • versionedOptionState

      @Deprecated static OptionState.VersionedBuilder versionedOptionState()
      Deprecated.
      for removal since 1.1.0, create states via OptionSchema.versionedStateBuilder() instead
      Create a builder for a versioned option state.
      Returns:
      the builder
      Since:
      1.0.0
    • schema

      OptionSchema schema()
      Get the option schema defining options that can be set within this state.
      Returns:
      the option schema
      Since:
      1.1.0
    • has

      boolean has(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> @Nullable V value(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