Package net.kyori.option
Interface OptionSchema
- All Known Subinterfaces:
OptionSchema.Mutable
@NonExtendable
public interface OptionSchema
Represents a 'universe' of known options.
- Since:
- 1.1.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA mutable view of an option schema that allows registering new options into the schema. -
Method Summary
Modifier and TypeMethodDescriptionstatic OptionSchema.MutablechildSchema(OptionSchema schema) Return a mutable schema that's a child of the specified schema.static OptionSchema.MutableCreate an empty schema inheriting from nothing but the contents of the global schema at invocation time.Create an empty option state within this schema.static OptionSchema.MutableRetrieve the globally-shared option schema.booleanReturn whether the provided option is known within this scheam.Return all known options contained within this schema, and recursively through its parents.Create a builder for an unversioned option state containing only options within this schema.Create a builder for a versioned option state containing only values for options within this schema.
-
Method Details
-
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
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
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
Return all known options contained within this schema, and recursively through its parents.- Returns:
- known options
- Since:
- 1.1.0
-
has
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
-