Interface CommandContainer<T>

  • All Superinterfaces:
    ChainCommand<T>, Command<T>, ProcessCommand<T>
    All Known Implementing Classes:
    DefaultCommandContainer

    public interface CommandContainer<T>
    extends ProcessCommand<T>
    Interface of a command container. A command container implements all command interfaces. So you can execute commandContainer as usual commands. Actually this implements the composite pattern. So you can mix commands and command container to build chains.
    Author:
    Manfred Wolff
    • Method Detail

      • addCommand

        CommandContainer<T> addCommand​(Command<T> parameterObject)
        Adds a Command to the list. Because a CommandContainer is a Command you can add CommandContainer objects as well.
        Parameters:
        parameterObject - The command to add.
        Returns:
        this
      • addCommand

        CommandContainer<T> addCommand​(int priority,
                                       Command<T> command)
        Adds a Command to the list via priority. Because a CommandContainer is a Command you can add CommandContainer objects as well.
        Parameters:
        priority - A priority. If two commands has the same priority the first wins.
        command - The command to add.
        Returns:
        this
      • getCommandByProcessID

        Optional<ProcessCommand<T>> getCommandByProcessID​(String processID)
        Gets the command with the certain processID.
        Parameters:
        processID - The id to find the command.
        Returns:
        The command with the certain processID