Package net.luckperms.api.query
Interface QueryOptions.Builder
-
- Enclosing interface:
- QueryOptions
@NonExtendable public static interface QueryOptions.Builder
Builder forQueryOptions.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NonNull QueryOptionsbuild()Builds aQueryOptionsinstance from the properties defined to the builder.@NonNull QueryOptions.Buildercontext(@NonNull ContextSet context)Sets the context.@NonNull QueryOptions.Builderflag(@NonNull Flag flag, boolean value)Sets the value of the given flag.@NonNull QueryOptions.Builderflags(@NonNull Set<Flag> flags)Sets the flags.@NonNull QueryOptions.Buildermode(@NonNull QueryMode mode)Sets theQueryMode.<O> @NonNull QueryOptions.Builderoption(@NonNull OptionKey<O> key, @Nullable O value)Sets the value of the given option.
-
-
-
Method Detail
-
mode
@NonNull QueryOptions.Builder mode(@NonNull QueryMode mode)
Sets theQueryMode.- Parameters:
mode- the mode to set- Returns:
- this builder
-
context
@NonNull QueryOptions.Builder context(@NonNull ContextSet context)
Sets the context.Note that this is a set operation, not append. Existing contexts will be overridden.
Throws
IllegalStateExceptionif the mode is notQueryMode.CONTEXTUAL.- Parameters:
context- the context to set- Returns:
- this builder
-
flag
@NonNull QueryOptions.Builder flag(@NonNull Flag flag, boolean value)
Sets the value of the given flag.By default, all
Flags are set to true.- Parameters:
flag- the flagvalue- the value to set- Returns:
- this builder
-
flags
@NonNull QueryOptions.Builder flags(@NonNull Set<Flag> flags)
Sets the flags.Note that this is a set operation, not append. Existing flags will be overridden.
By default, all
Flags are set to true.- Parameters:
flags- the flags- Returns:
- this builder
-
option
<O> @NonNull QueryOptions.Builder option(@NonNull OptionKey<O> key, @Nullable O value)
Sets the value of the given option.Passing
nullin place of a value will clear any existing value set for the key.- Type Parameters:
O- the option type- Parameters:
key- the option keyvalue- the value, or null to clear- Returns:
- this builder
-
build
@NonNull QueryOptions build()
Builds aQueryOptionsinstance from the properties defined to the builder.- Returns:
- a
QueryOptionsinstance.
-
-