Interface Commands


public interface Commands
Interface for managing commands
  • Method Summary

    Modifier and Type
    Method
    Description
    io.github.jwdeveloper.spigot.commands.api.argumetns.ArgumentTypes
    Argument types registry object, modify of create new commands arguments
    io.github.jwdeveloper.spigot.commands.api.builder.CommandBuilder
    create(Object templateObject)
    Creates a new command builder for a command using the specified template object.
    io.github.jwdeveloper.spigot.commands.api.builder.CommandBuilder
    create(String pattern)
    Creates a new command builder for a command with the specified pattern.
    Finds and returns all commands managed by the command manager.
    java.util.stream.Stream<Command>
    findBy(java.util.function.Predicate<Command> predicate)
    Finds and returns commands that match the specified predicate.
    findByName(String commandName)
    Finds and returns a command with the specified name.
    io.github.jwdeveloper.spigot.commands.api.services.EventsService
    Global event handler for the commands events
    io.github.jwdeveloper.spigot.commands.api.patterns.Patterns
     
    void
    register(Command command)
    Adds the specified command to the command manager.
    void
    Removes all commands from the command manager.
    void
    Removes the specified command from the command manager.
  • Method Details

    • globalEvents

      io.github.jwdeveloper.spigot.commands.api.services.EventsService globalEvents()
      Global event handler for the commands events
      Returns:
      eventHandler
    • patterns

      io.github.jwdeveloper.spigot.commands.api.patterns.Patterns patterns()
    • argumentTypes

      io.github.jwdeveloper.spigot.commands.api.argumetns.ArgumentTypes argumentTypes()
      Argument types registry object, modify of create new commands arguments
      Returns:
      a new instance of ArgumentTypes.
    • create

      io.github.jwdeveloper.spigot.commands.api.builder.CommandBuilder create(String pattern)
      Creates a new command builder for a command with the specified pattern.
      Parameters:
      pattern - the pattern for the command.
      Returns:
      a new instance of CommandBuilder.
    • create

      io.github.jwdeveloper.spigot.commands.api.builder.CommandBuilder create(Object templateObject)
      Creates a new command builder for a command using the specified template object.
      Parameters:
      templateObject - the template object for the command.
      Returns:
      a new instance of CommandBuilder.
    • register

      void register(Command command)
      Adds the specified command to the command manager.
      Parameters:
      command - the command to be added.
    • unregister

      void unregister(Command command)
      Removes the specified command from the command manager.
      Parameters:
      command - the command to be removed.
    • removeAll

      void removeAll()
      Removes all commands from the command manager.
    • findAll

      List<Command> findAll()
      Finds and returns all commands managed by the command manager.
      Returns:
      a list of all commands.
    • findBy

      java.util.stream.Stream<Command> findBy(java.util.function.Predicate<Command> predicate)
      Finds and returns commands that match the specified predicate.
      Parameters:
      predicate - the predicate to filter commands.
      Returns:
      a stream of commands that match the predicate.
    • findByName

      Optional<Command> findByName(String commandName)
      Finds and returns a command with the specified name.
      Parameters:
      commandName - the name of the command.
      Returns:
      an optional containing the command if found, or empty if not found.