Interface OptionSchema

All Known Subinterfaces:
OptionSchema.Mutable

@NonExtendable public interface OptionSchema
Represents a 'universe' of known options.
Since:
1.1.0
  • Method Details

    • globalSchema

      static OptionSchema.Mutable globalSchema()
      Retrieve the globally-shared option schema.

      This mostly exists for backwards compatibility, and should not be used in new software.

      Returns:
      the global schema
      Since:
      1.1.0
    • childSchema

      static OptionSchema.Mutable childSchema(OptionSchema schema)
      Return a mutable schema that's a child of the specified schema.

      This schema will inherit all options defined in the parent schema at the time the child schema is created.

      Parameters:
      schema - the parent schema
      Returns:
      the mutable child schema
      Since:
      1.1.0
    • emptySchema

      static OptionSchema.Mutable emptySchema()
      Create an empty schema inheriting from nothing but the contents of the global schema at invocation time.
      Returns:
      a mutable schema
      Since:
      1.1.0
    • knownOptions

      Set<Option<?>> knownOptions()
      Return all known options contained within this schema, and recursively through its parents.
      Returns:
      known options
      Since:
      1.1.0
    • has

      boolean has(Option<?> option)
      Return whether the provided option is known within this scheam.
      Parameters:
      option - the option
      Returns:
      whether the option is known
      Since:
      1.1.0
    • stateBuilder

      OptionState.Builder stateBuilder()
      Create a builder for an unversioned option state containing only options within this schema.
      Returns:
      the builder
      Since:
      1.1.0
    • versionedStateBuilder

      OptionState.VersionedBuilder versionedStateBuilder()
      Create a builder for a versioned option state containing only values for options within this schema.
      Returns:
      the builder
      Since:
      1.1.0
    • emptyState

      OptionState emptyState()
      Create an empty option state within this schema.
      Returns:
      the empty state
      Since:
      1.1.0