Package alluxio.shell
Class CommandReturn
- java.lang.Object
-
- alluxio.shell.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.
-
-
-
Constructor Detail
-
CommandReturn
public CommandReturn(int code, java.lang.String output)
Creates object from the contents.- Parameters:
code
- exit codeoutput
- 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 codecmd
- the command executedoutput
- 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
-
-