Package dev.rollczi.litecommands
Interface LiteCommandsBuilder<SENDER,SETTINGS extends dev.rollczi.litecommands.platform.PlatformSettings,B extends LiteCommandsBuilder<SENDER,SETTINGS,B>>
- Type Parameters:
SENDER- type of senderSETTINGS- type of platform settingsB- self type for builder
- All Known Implementing Classes:
LiteCommandsBaseBuilder
public interface LiteCommandsBuilder<SENDER,SETTINGS extends dev.rollczi.litecommands.platform.PlatformSettings,B extends LiteCommandsBuilder<SENDER,SETTINGS,B>>
Builder for
LiteCommands.
Use LiteCommandsFactory.builder(Class, Platform) to create new instance of builder.-
Method Summary
Modifier and TypeMethodDescriptionannotations(LiteConfigurator<AnnotationsExtension<SENDER>> configurator) [Experimental] Register extension for annotations processing/ Please note that this method is experimental and may be deprecated or removed in the future.<T> Bargument(dev.rollczi.litecommands.reflect.type.TypeRange<T> type, dev.rollczi.litecommands.argument.ArgumentKey key, dev.rollczi.litecommands.argument.resolver.ArgumentResolverBase<SENDER, T> resolver) <T> Bargument(dev.rollczi.litecommands.reflect.type.TypeRange<T> type, dev.rollczi.litecommands.argument.resolver.ArgumentResolverBase<SENDER, T> resolver) <T> Bargument(Class<T> type, dev.rollczi.litecommands.argument.ArgumentKey key, dev.rollczi.litecommands.argument.resolver.ArgumentResolverBase<SENDER, T> resolver) [Keyed Argument Parser and Suggester] Register argument parser and suggester for a given type and key.<T> Bargument(Class<T> type, dev.rollczi.litecommands.argument.resolver.ArgumentResolverBase<SENDER, T> resolver) [Argument Parser and Suggester] Register argument parser and suggester for given type.<T> BargumentParser(dev.rollczi.litecommands.reflect.type.TypeRange<T> type, dev.rollczi.litecommands.argument.ArgumentKey key, dev.rollczi.litecommands.argument.parser.Parser<SENDER, T> parser) <T> BargumentParser(Class<T> type, dev.rollczi.litecommands.argument.ArgumentKey key, dev.rollczi.litecommands.argument.parser.Parser<SENDER, T> parser) <T> BargumentParser(Class<T> type, dev.rollczi.litecommands.argument.parser.Parser<SENDER, T> parser) <T> BargumentSuggester(dev.rollczi.litecommands.reflect.type.TypeRange<T> type, dev.rollczi.litecommands.argument.ArgumentKey key, dev.rollczi.litecommands.argument.suggester.Suggester<SENDER, T> suggester) <T> BargumentSuggester(Class<T> type, dev.rollczi.litecommands.argument.ArgumentKey key, dev.rollczi.litecommands.argument.suggester.Suggester<SENDER, T> suggester) default <T> BargumentSuggester(Class<T> type, dev.rollczi.litecommands.argument.ArgumentKey key, dev.rollczi.litecommands.suggestion.SuggestionResult suggestion) Deprecated.<T> BargumentSuggester(Class<T> type, dev.rollczi.litecommands.argument.suggester.Suggester<SENDER, T> suggester) default <T> BargumentSuggester(Class<T> type, dev.rollczi.litecommands.suggestion.SuggestionResult suggestion) Deprecated.<T> BargumentSuggestion(dev.rollczi.litecommands.reflect.type.TypeRange<T> type, dev.rollczi.litecommands.argument.ArgumentKey key, dev.rollczi.litecommands.suggestion.SuggestionResult suggestion) <T> BargumentSuggestion(Class<T> type, dev.rollczi.litecommands.argument.ArgumentKey key, dev.rollczi.litecommands.suggestion.SuggestionResult suggestion) <T> BargumentSuggestion(Class<T> type, dev.rollczi.litecommands.suggestion.SuggestionResult suggestion) <T> B<T> BbindUnsafe(Class<?> on, Supplier<?> bind) dev.rollczi.litecommands.LiteCommands<SENDER> build()dev.rollczi.litecommands.LiteCommands<SENDER> build(boolean register) Register commands from given provider.This method is used to register additional commands.<T> Beditor(dev.rollczi.litecommands.scope.Scope scope, dev.rollczi.litecommands.editor.Editor<SENDER> editor) editorGlobal(dev.rollczi.litecommands.editor.Editor<SENDER> editor) exception(Class<E> exceptionType, dev.rollczi.litecommands.handler.exception.ExceptionHandler<SENDER, ? extends E> handler) exceptionUnexpected(dev.rollczi.litecommands.handler.exception.ExceptionHandler<SENDER, Throwable> handler) <CONFIGURATION>
Bextension(LiteExtension<SENDER, CONFIGURATION> extension) Register extension for this builder.<CONFIGURATION,E extends LiteExtension<SENDER, CONFIGURATION>>
Bextension(E extension, LiteConfigurator<CONFIGURATION> configurator) Register extension for this builder with configurator.invalidUsage(dev.rollczi.litecommands.invalidusage.InvalidUsageHandler<SENDER> handler) <T,CONTEXT>
Bmessage(dev.rollczi.litecommands.message.MessageKey<CONTEXT> key, dev.rollczi.litecommands.message.InvokedMessage<SENDER, T, CONTEXT> message) <T,CONTEXT>
Bmessage(dev.rollczi.litecommands.message.MessageKey<CONTEXT> key, dev.rollczi.litecommands.message.Message<T, CONTEXT> message) <T,CONTEXT>
Bmessage(dev.rollczi.litecommands.message.MessageKey<CONTEXT> key, T message) missingPermission(dev.rollczi.litecommands.permission.MissingPermissionsHandler<SENDER> handler) postProcessor(LiteBuilderProcessor<SENDER, SETTINGS> postProcessor) preProcessor(LiteBuilderProcessor<SENDER, SETTINGS> preProcessor) <T> Bresult(Class<T> resultType, dev.rollczi.litecommands.handler.result.ResultHandler<SENDER, ? extends T> handler) resultUnexpected(dev.rollczi.litecommands.handler.result.ResultHandler<SENDER, Object> handler) scheduler(dev.rollczi.litecommands.scheduler.Scheduler scheduler) schematicGenerator(dev.rollczi.litecommands.schematic.SchematicFormat format) schematicGenerator(dev.rollczi.litecommands.schematic.SchematicGenerator<SENDER> schematicGenerator) selfProcessor(LiteBuilderProcessor<SENDER, SETTINGS> processor) Configure platform settings.validator(dev.rollczi.litecommands.scope.Scope scope, dev.rollczi.litecommands.validator.Validator<SENDER> validator) validatorGlobal(dev.rollczi.litecommands.validator.Validator<SENDER> validator) default BvalidatorMarked(dev.rollczi.litecommands.validator.Validator<SENDER> validator) wrapper(dev.rollczi.litecommands.wrapper.Wrapper wrapper)
-
Method Details
-
settings
Configure platform settings.- Parameters:
configurator- configurator for platform settings- Returns:
- this builder
- See Also:
-
commands
Register commands from given provider.- Parameters:
commandsProvider- provider of commands- Returns:
- this builder
- See Also:
-
commands
This method is used to register additional commands. There are several types of objects that can be registered: Using annotations:- An instance annotated with
Command - An instance annotated with
RootCommand - A class annotated with
Command - A class annotated with
RootCommand
- An instance of
LiteCommand
- Parameters:
commands- commands to register- Returns:
- This method returns the current LiteCommand builder instance This allows you to chain multiple calls together, using the builder design pattern.
- See Also:
- An instance annotated with
-
argumentParser
-
argumentParser
-
argumentParser
-
argumentSuggestion
-
argumentSuggestion
-
argumentSuggestion
<T> B argumentSuggestion(dev.rollczi.litecommands.reflect.type.TypeRange<T> type, dev.rollczi.litecommands.argument.ArgumentKey key, dev.rollczi.litecommands.suggestion.SuggestionResult suggestion) -
argumentSuggester
@Deprecated @ScheduledForRemoval(inVersion="3.5.0") default <T> B argumentSuggester(Class<T> type, dev.rollczi.litecommands.suggestion.SuggestionResult suggestion) Deprecated. -
argumentSuggester
@Deprecated @ScheduledForRemoval(inVersion="3.5.0") default <T> B argumentSuggester(Class<T> type, dev.rollczi.litecommands.argument.ArgumentKey key, dev.rollczi.litecommands.suggestion.SuggestionResult suggestion) Deprecated. -
argumentSuggester
-
argumentSuggester
-
argumentSuggester
-
argument
<T> B argument(Class<T> type, dev.rollczi.litecommands.argument.resolver.ArgumentResolverBase<SENDER, T> resolver) [Argument Parser and Suggester] Register argument parser and suggester for given type.- Parameters:
type- type of argumentresolver- parser and suggester for a given type- Returns:
- this builder
-
argument
<T> B argument(Class<T> type, dev.rollczi.litecommands.argument.ArgumentKey key, dev.rollczi.litecommands.argument.resolver.ArgumentResolverBase<SENDER, T> resolver) [Keyed Argument Parser and Suggester] Register argument parser and suggester for a given type and key. Key is used to define namespace for given parser. It is used to identify which parsers with same type should be used. Argument type is used to define what type is compatible with given parser.- Parameters:
type- type of argumentkey- key of argumentresolver- parser and suggester for a given type- Returns:
- this builder
-
argument
-
argument
-
context
-
bind
-
bind
-
bindUnsafe
-
scheduler
-
message
<T,CONTEXT> B message(dev.rollczi.litecommands.message.MessageKey<CONTEXT> key, dev.rollczi.litecommands.message.Message<T, CONTEXT> message) -
message
-
message
-
editorGlobal
-
editor
-
validatorGlobal
-
validator
-
validatorMarked
-
result
-
resultUnexpected
-
exception
-
exceptionUnexpected
-
missingPermission
-
invalidUsage
-
wrapper
-
schematicGenerator
-
schematicGenerator
-
selfProcessor
-
preProcessor
-
postProcessor
-
extension
Register extension for this builder.- Type Parameters:
CONFIGURATION- type of configuration- Parameters:
extension- extension to register Example:.extension(new LiteAdventureExtension<>())- Returns:
- this builder
-
extension
<CONFIGURATION,E extends LiteExtension<SENDER, B extensionCONFIGURATION>> (E extension, LiteConfigurator<CONFIGURATION> configurator) Register extension for this builder with configurator.- Type Parameters:
CONFIGURATION- type of configuration- Parameters:
extension- extension to registerconfigurator- configurator for extension Example:.extension(new LiteAdventureExtension<>(), configuration -> configuration .colorizeArgument(true) .miniMessage(true) .legacyColor(true) .serializer(ComponentSerializer.miniMessage()) )- Returns:
- this builder
-
annotations
[Experimental] Register extension for annotations processing/ Please note that this method is experimental and may be deprecated or removed in the future.- Parameters:
configurator- configurator for extension- processor - register new annotation processor
- validator - register new validator for requirement
.extensionAnnotation(extension -> extension .processor(new MyAnnotationProcessor()) .validator(String.class, IsValid.class, new StringValidator()) )- Returns:
- this builder
-
build
dev.rollczi.litecommands.LiteCommands<SENDER> build() -
build
-