Interface LiteCommandsBuilder<SENDER,SETTINGS extends dev.rollczi.litecommands.platform.PlatformSettings,B extends LiteCommandsBuilder<SENDER,SETTINGS,B>>

Type Parameters:
SENDER - type of sender
SETTINGS - type of platform settings
B - 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 Details

    • settings

      LiteCommandsBuilder<SENDER,SETTINGS,B> settings(dev.rollczi.litecommands.platform.PlatformSettingsConfigurator<SETTINGS> configurator)
      Configure platform settings.
      Parameters:
      configurator - configurator for platform settings
      Returns:
      this builder
      See Also:
      • PlatformSettings
    • commands

      LiteCommandsBuilder<SENDER,SETTINGS,B> commands(dev.rollczi.litecommands.LiteCommandsProvider<SENDER> commandsProvider)
      Register commands from given provider.
      Parameters:
      commandsProvider - provider of commands
      Returns:
      this builder
      See Also:
    • commands

      @Experimental LiteCommandsBuilder<SENDER,SETTINGS,B> commands(Object... 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
      Programmatically:
      • An instance of LiteCommand
      Please note that this method is experimental and may be deprecated or removed in the future.
      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:
    • argumentParser

      <IN, T, PARSER extends dev.rollczi.litecommands.argument.parser.Parser<SENDER, IN, T>> LiteCommandsBuilder<SENDER,SETTINGS,B> argumentParser(Class<T> type, PARSER parser)
    • argumentParser

      <IN, T, PARSER extends dev.rollczi.litecommands.argument.parser.Parser<SENDER, IN, T>> LiteCommandsBuilder<SENDER,SETTINGS,B> argumentParser(Class<T> type, dev.rollczi.litecommands.argument.ArgumentKey key, PARSER parser)
    • argumentParser

      <IN, T, ARGUMENT extends dev.rollczi.litecommands.argument.Argument<T>> LiteCommandsBuilder<SENDER,SETTINGS,B> argumentParser(Class<T> type, dev.rollczi.litecommands.argument.parser.TypedParser<SENDER,IN,T,ARGUMENT> parser)
    • argumentParser

      <IN, T, ARGUMENT extends dev.rollczi.litecommands.argument.Argument<T>> LiteCommandsBuilder<SENDER,SETTINGS,B> argumentParser(Class<T> type, dev.rollczi.litecommands.argument.ArgumentKey key, dev.rollczi.litecommands.argument.parser.TypedParser<SENDER,IN,T,ARGUMENT> parser)
    • argumentSuggester

      <T> LiteCommandsBuilder<SENDER,SETTINGS,B> argumentSuggester(Class<T> type, dev.rollczi.litecommands.suggestion.SuggestionResult suggestionResult)
    • argumentSuggester

      <T> LiteCommandsBuilder<SENDER,SETTINGS,B> argumentSuggester(Class<T> type, dev.rollczi.litecommands.argument.ArgumentKey key, dev.rollczi.litecommands.suggestion.SuggestionResult suggestionResult)
    • argumentSuggester

      <T, SUGGESTER extends dev.rollczi.litecommands.argument.suggester.Suggester<SENDER, T>> LiteCommandsBuilder<SENDER,SETTINGS,B> argumentSuggester(Class<T> type, SUGGESTER suggester)
    • argumentSuggester

      <T, SUGGESTER extends dev.rollczi.litecommands.argument.suggester.Suggester<SENDER, T>> LiteCommandsBuilder<SENDER,SETTINGS,B> argumentSuggester(Class<T> type, dev.rollczi.litecommands.argument.ArgumentKey key, SUGGESTER suggester)
    • argumentSuggester

      <T, ARGUMENT extends dev.rollczi.litecommands.argument.Argument<T>> LiteCommandsBuilder<SENDER,SETTINGS,B> argumentSuggester(Class<T> type, dev.rollczi.litecommands.argument.suggester.TypedSuggester<SENDER,T,ARGUMENT> suggester)
    • argumentSuggester

      <T, ARGUMENT extends dev.rollczi.litecommands.argument.Argument<T>> LiteCommandsBuilder<SENDER,SETTINGS,B> argumentSuggester(Class<T> type, dev.rollczi.litecommands.argument.ArgumentKey key, dev.rollczi.litecommands.argument.suggester.TypedSuggester<SENDER,T,ARGUMENT> suggester)
    • argument

      <IN, T, RESOLVER extends dev.rollczi.litecommands.argument.parser.Parser<SENDER, IN, T> & dev.rollczi.litecommands.argument.suggester.Suggester<SENDER, T>> LiteCommandsBuilder<SENDER,SETTINGS,B> argument(Class<T> type, RESOLVER resolver)
      [Argument Parser and Suggester] Register argument parser and suggester for given type.
      Parameters:
      type - type of argument
      resolver - parser and suggester for given type
      Returns:
      this builder
    • argument

      <IN, T, RESOLVER extends dev.rollczi.litecommands.argument.parser.Parser<SENDER, IN, T> & dev.rollczi.litecommands.argument.suggester.Suggester<SENDER, T>> LiteCommandsBuilder<SENDER,SETTINGS,B> argument(Class<T> type, dev.rollczi.litecommands.argument.ArgumentKey key, RESOLVER resolver)
      [Keyed Argument Parser and Suggester] Register argument parser and suggester for 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 argument
      key - key of argument
      resolver - parser and suggester for given type
      Returns:
      this builder
    • argument

      <IN, T, ARGUMENT extends dev.rollczi.litecommands.argument.Argument<T>, RESOLVER extends dev.rollczi.litecommands.argument.parser.TypedParser<SENDER, IN, T, ARGUMENT> & dev.rollczi.litecommands.argument.suggester.Suggester<SENDER, T>> LiteCommandsBuilder<SENDER,SETTINGS,B> argument(Class<T> type, RESOLVER resolver)
      [Typed Argument Parser and Suggester] Register argument parser and suggester for given type.
      Parameters:
      type - type of argument
      resolver - parser and suggester for given type
      Returns:
      this builder
    • argument

      <IN, T, ARGUMENT extends dev.rollczi.litecommands.argument.Argument<T>, RESOLVER extends dev.rollczi.litecommands.argument.parser.TypedParser<SENDER, IN, T, ARGUMENT> & dev.rollczi.litecommands.argument.suggester.Suggester<SENDER, T>> LiteCommandsBuilder<SENDER,SETTINGS,B> argument(Class<T> type, dev.rollczi.litecommands.argument.ArgumentKey key, RESOLVER resolver)
      [Typed Keyed Argument Parser and Suggester] Register argument parser and suggester for 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 argument
      key - key of argument
      resolver - parser and suggester for given type
      Returns:
      this builder
    • context

      <T> LiteCommandsBuilder<SENDER,SETTINGS,B> context(Class<T> on, dev.rollczi.litecommands.context.ContextProvider<SENDER,T> bind)
    • bind

      <T> LiteCommandsBuilder<SENDER,SETTINGS,B> bind(Class<T> on, dev.rollczi.litecommands.bind.BindProvider<T> bindProvider)
    • bind

      <T> LiteCommandsBuilder<SENDER,SETTINGS,B> bind(Class<T> on, Supplier<T> bind)
    • bindUnsafe

      LiteCommandsBuilder<SENDER,SETTINGS,B> bindUnsafe(Class<?> on, Supplier<?> bind)
    • scheduler

      LiteCommandsBuilder<SENDER,SETTINGS,B> scheduler(dev.rollczi.litecommands.scheduler.Scheduler scheduler)
    • message

      <T, CONTEXT> LiteCommandsBuilder<SENDER,SETTINGS,B> message(dev.rollczi.litecommands.message.MessageKey<CONTEXT> key, dev.rollczi.litecommands.message.Message<T,CONTEXT> message)
    • message

      <T, CONTEXT> LiteCommandsBuilder<SENDER,SETTINGS,B> message(dev.rollczi.litecommands.message.MessageKey<CONTEXT> key, dev.rollczi.litecommands.message.InvokedMessage<SENDER,T,CONTEXT> message)
    • message

      <T, CONTEXT> LiteCommandsBuilder<SENDER,SETTINGS,B> message(dev.rollczi.litecommands.message.MessageKey<CONTEXT> key, T message)
    • editorGlobal

      LiteCommandsBuilder<SENDER,SETTINGS,B> editorGlobal(dev.rollczi.litecommands.editor.Editor<SENDER> editor)
    • editor

      LiteCommandsBuilder<SENDER,SETTINGS,B> editor(dev.rollczi.litecommands.scope.Scope scope, dev.rollczi.litecommands.editor.Editor<SENDER> editor)
    • validatorGlobal

      LiteCommandsBuilder<SENDER,SETTINGS,B> validatorGlobal(dev.rollczi.litecommands.validator.Validator<SENDER> validator)
    • validator

      LiteCommandsBuilder<SENDER,SETTINGS,B> validator(dev.rollczi.litecommands.scope.Scope scope, dev.rollczi.litecommands.validator.Validator<SENDER> validator)
    • validatorMarked

      default LiteCommandsBuilder<SENDER,SETTINGS,B> validatorMarked(dev.rollczi.litecommands.validator.Validator<SENDER> validator)
    • result

      <T> LiteCommandsBuilder<SENDER,SETTINGS,B> result(Class<T> resultType, dev.rollczi.litecommands.handler.result.ResultHandler<SENDER,? extends T> handler)
    • resultUnexpected

      LiteCommandsBuilder<SENDER,SETTINGS,B> resultUnexpected(dev.rollczi.litecommands.handler.result.ResultHandler<SENDER,Object> handler)
    • exception

      <E extends Throwable> LiteCommandsBuilder<SENDER,SETTINGS,B> exception(Class<E> exceptionType, dev.rollczi.litecommands.handler.exception.ExceptionHandler<SENDER,? extends E> handler)
    • exceptionUnexpected

      LiteCommandsBuilder<SENDER,SETTINGS,B> exceptionUnexpected(dev.rollczi.litecommands.handler.exception.ExceptionHandler<SENDER,Throwable> handler)
    • missingPermission

      LiteCommandsBuilder<SENDER,SETTINGS,B> missingPermission(dev.rollczi.litecommands.permission.MissingPermissionsHandler<SENDER> handler)
    • invalidUsage

      LiteCommandsBuilder<SENDER,SETTINGS,B> invalidUsage(dev.rollczi.litecommands.invalidusage.InvalidUsageHandler<SENDER> handler)
    • wrapper

      LiteCommandsBuilder<SENDER,SETTINGS,B> wrapper(dev.rollczi.litecommands.wrapper.Wrapper wrapper)
    • schematicGenerator

      LiteCommandsBuilder<SENDER,SETTINGS,B> schematicGenerator(dev.rollczi.litecommands.schematic.SchematicGenerator<SENDER> schematicGenerator)
    • schematicGenerator

      LiteCommandsBuilder<SENDER,SETTINGS,B> schematicGenerator(dev.rollczi.litecommands.schematic.SchematicFormat format)
    • selfProcessor

    • preProcessor

    • postProcessor

    • extension

      <CONFIGURATION> LiteCommandsBuilder<SENDER,SETTINGS,B> extension(LiteExtension<SENDER,CONFIGURATION> 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, CONFIGURATION>> LiteCommandsBuilder<SENDER,SETTINGS,B> extension(E extension, LiteConfigurator<CONFIGURATION> configurator)
      Register extension for this builder with configurator.
      Type Parameters:
      CONFIGURATION - type of configuration
      Parameters:
      extension - extension to register
      configurator - configurator for extension Example:
        
        .extension(new LiteAdventureExtension<>(), configuration -> configuration
          .colorizeArgument(true)
          .miniMessage(true)
          .legacyColor(true)
          .serializer(ComponentSerializer.miniMessage())
        )
        
       
      Returns:
      this builder
    • annotations

      @Experimental LiteCommandsBuilder<SENDER,SETTINGS,B> annotations(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.
      Parameters:
      configurator - configurator for extension
      • processor - register new annotation processor
      • validator - register new validator for requirement
      Example:
       
       .extensionAnnotation(extension -> extension
           .processor(new MyAnnotationProcessor())
           .validator(String.class, IsValid.class, new StringValidator())
       )
       
       
      Returns:
      this builder
    • build

      dev.rollczi.litecommands.LiteCommands<SENDER> build()
    • build

      dev.rollczi.litecommands.LiteCommands<SENDER> build(boolean register)