CommandResult

public class CommandResult
extends Object

java.lang.Object
   ↳ com.android.tradefed.util.CommandResult


Contains the result of a command.

Summary

Public constructors

CommandResult()

Create a CommandResult with the default CommandStatus#TIMED_OUT status.

CommandResult(CommandStatus status)

Create a CommandResult with the given status.

Public methods

Integer getExitCode()

Get the exit/return code produced by command.

CommandStatus getStatus()

Get status of command.

String getStderr()

Get the standard error output produced by command.

String getStdout()

Get the standard output produced by command.

boolean isCached()

Returns whether this result is a cached result or not.

void setCached(boolean cached)
void setExitCode(int exitCode)
void setStatus(CommandStatus status)
void setStderr(String stderr)
void setStdout(String stdout)
String toString()

Returns a string representation of this object.

Public constructors

CommandResult

public CommandResult ()

Create a CommandResult with the default CommandStatus#TIMED_OUT status.

CommandResult

public CommandResult (CommandStatus status)

Create a CommandResult with the given status.

Parameters
status CommandStatus: the CommandStatus

Public methods

getExitCode

public Integer getExitCode ()

Get the exit/return code produced by command.

Returns
Integer the exit code or null if it is unset

getStatus

public CommandStatus getStatus ()

Get status of command.

Returns
CommandStatus the CommandStatus

getStderr

public String getStderr ()

Get the standard error output produced by command.

Returns
String the standard error or null if output could not be retrieved

getStdout

public String getStdout ()

Get the standard output produced by command.

Returns
String the standard output or null if output could not be retrieved

isCached

public boolean isCached ()

Returns whether this result is a cached result or not.

Returns
boolean

setCached

public void setCached (boolean cached)

Parameters
cached boolean

setExitCode

public void setExitCode (int exitCode)

Parameters
exitCode int

setStatus

public void setStatus (CommandStatus status)

Parameters
status CommandStatus

setStderr

public void setStderr (String stderr)

Parameters
stderr String

setStdout

public void setStdout (String stdout)

Parameters
stdout String

toString

public String toString ()

Returns a string representation of this object. Stdout/err can be very large.

Returns
String