Class CommandResult

  • All Implemented Interfaces:
    Serializable

    public class CommandResult
    extends Object
    implements Serializable
    Container class for storing command, exit code and stdout/stderr output.
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • command

        public String[] command
        the command that was executed.
      • exitCode

        public int exitCode
        the exit code of the command.
      • stdout

        public String stdout
        the output on stdout, if any.
      • stderr

        public String stderr
        the output on stderr, if any.
    • Constructor Detail

      • CommandResult

        public CommandResult​(String[] command,
                             int exitCode)
        Initializes the container.
        Parameters:
        command - the command that was executed
        exitCode - the exit code of the command
      • CommandResult

        public CommandResult​(String[] command,
                             int exitCode,
                             String stdout,
                             String stderr)
        Initializes the container.
        Parameters:
        command - the command that was executed
        exitCode - the exit code of the command
        stdout - the output on stdout, can be null
        stderr - the output on stderr, can be null
    • Method Detail

      • toString

        public String toString()
        The container as a string representation.
        Overrides:
        toString in class Object
        Returns:
        the string representation