Package alluxio.shell

Class CommandReturn


  • public class CommandReturn
    extends java.lang.Object
    Object representation of a command execution.
    • Constructor Summary

      Constructors 
      Constructor Description
      CommandReturn​(int code, java.lang.String output)
      Creates object from the contents.
      CommandReturn​(int code, java.lang.String[] cmd, java.lang.String output)
      Creates object from the contents.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String[] getCmd()
      Gets the command run.
      int getExitCode()
      Gets the exit code.
      java.lang.String getFormattedOutput()
      Formats the object to more readable format.
      java.lang.String getOutput()
      Gets the stdout content.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CommandReturn

        public CommandReturn​(int code,
                             java.lang.String output)
        Creates object from the contents.
        Parameters:
        code - exit code
        output - stdout content
      • CommandReturn

        public CommandReturn​(int code,
                             java.lang.String[] cmd,
                             java.lang.String output)
        Creates object from the contents. Copy the command array.
        Parameters:
        code - exit code
        cmd - the command executed
        output - stdout content
    • Method Detail

      • getExitCode

        public int getExitCode()
        Gets the exit code.
        Returns:
        exit code of execution
      • getCmd

        public java.lang.String[] getCmd()
        Gets the command run.
        Returns:
        the command
      • getOutput

        public java.lang.String getOutput()
        Gets the stdout content.
        Returns:
        stdout content
      • getFormattedOutput

        public java.lang.String getFormattedOutput()
        Formats the object to more readable format. This is not done in toString() because stdout and stderr may be long.
        Returns:
        pretty formatted output