Interface ICommandMap

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      boolean dispatchCommand​(ICommandSender commandSender, java.lang.String commandLine)
      Invokes a command execute() method when there is contain in the map and parsed from the command line the additional properties.
      Command getCommand​(java.lang.String name)
      Returns the command in the map with a specific name.
      Command getCommandFromLine​(java.lang.String commandLine)
      Returns the command object from the custom command line
      java.util.Collection<CommandInfo> getCommandInfos()
      Transform all commands instances that are contain in the map into a CommandInfo object
      java.util.Collection<java.lang.String> getCommandNames()
      Returns all command names that are contain in the map
      void registerCommand​(Command command)
      Register a new command instance with all names that are is configured
      default void registerCommand​(Command... commands)
      Register new command instances with all names that are is configured
      void unregisterCommand​(java.lang.Class<? extends Command> command)
      Unregister all commands from the map, that command instance class is like the argument
      default void unregisterCommand​(java.lang.Class<? extends Command>... commands)
      Unregister all commands from the map, that command instance classes is like the argument
      void unregisterCommand​(java.lang.String command)
      Unregister all commands from the map, that has the following string as name
      default void unregisterCommand​(java.lang.String... commands)
      Unregister all commands from the map, that has the following string as name
      void unregisterCommands()
      Remove all commands from the command map
      void unregisterCommands​(java.lang.ClassLoader classLoader)
      Unregister all commands from the classLoader instance.
    • Method Detail

      • registerCommand

        void registerCommand​(Command command)
        Register a new command instance with all names that are is configured
        Parameters:
        command - the command that should registered
      • unregisterCommand

        void unregisterCommand​(java.lang.String command)
        Unregister all commands from the map, that has the following string as name
        Parameters:
        command - the command name that should remove from the map
      • unregisterCommand

        void unregisterCommand​(java.lang.Class<? extends Command> command)
        Unregister all commands from the map, that command instance class is like the argument
        Parameters:
        command - the class reference that should remove from the map
      • unregisterCommands

        void unregisterCommands​(java.lang.ClassLoader classLoader)
        Unregister all commands from the classLoader instance.
        Parameters:
        classLoader - the classLoader from that all commands, that are contain will remove
      • unregisterCommands

        void unregisterCommands()
        Remove all commands from the command map
      • getCommandInfos

        java.util.Collection<CommandInfo> getCommandInfos()
        Transform all commands instances that are contain in the map into a CommandInfo object
      • getCommandNames

        java.util.Collection<java.lang.String> getCommandNames()
        Returns all command names that are contain in the map
      • getCommand

        Command getCommand​(java.lang.String name)
        Returns the command in the map with a specific name. If the name is more than one exist. The first command instance that could be found will return
        Parameters:
        name - the name, from that the command should resolve
        Returns:
        first command instance that could be found
      • getCommandFromLine

        Command getCommandFromLine​(java.lang.String commandLine)
        Returns the command object from the custom command line
      • dispatchCommand

        boolean dispatchCommand​(ICommandSender commandSender,
                                java.lang.String commandLine)
        Invokes a command execute() method when there is contain in the map and parsed from the command line the additional properties.
        Parameters:
        commandSender - the command sender of the commandLine that should use
        commandLine - the following commandline that should dispatch
        Returns:
        true if the command will successful executed or false when the command cannot be found in the map or an exception was thrown
      • registerCommand

        default void registerCommand​(Command... commands)
        Register new command instances with all names that are is configured
        Parameters:
        commands - the commands that should registered
      • unregisterCommand

        default void unregisterCommand​(java.lang.String... commands)
        Unregister all commands from the map, that has the following string as name
        Parameters:
        commands - the command names that should remove from the map
      • unregisterCommand

        default void unregisterCommand​(java.lang.Class<? extends Command>... commands)
        Unregister all commands from the map, that command instance classes is like the argument
        Parameters:
        commands - the class references that should remove from the map