public class ExitStatus extends java.lang.Object implements java.io.Serializable, java.lang.Comparable<ExitStatus>
Modifier and Type | Field and Description |
---|---|
static ExitStatus |
COMPLETED
Convenient constant value representing finished processing.
|
static ExitStatus |
EXECUTING
Convenient constant value representing continuable state where processing
is still taking place, so no further action is required.
|
static ExitStatus |
FAILED
Convenient constant value representing finished processing with an error.
|
static ExitStatus |
NOOP
Convenient constant value representing job that did no processing (e.g.
|
static ExitStatus |
STOPPED
Convenient constant value representing finished processing with
interrupted status.
|
static ExitStatus |
UNKNOWN
Convenient constant value representing unknown state - assumed not
continuable.
|
Constructor and Description |
---|
ExitStatus(java.lang.String exitCode) |
ExitStatus(java.lang.String exitCode,
java.lang.String exitDescription) |
Modifier and Type | Method and Description |
---|---|
ExitStatus |
addExitDescription(java.lang.String description)
Add an exit description to an existing
ExitStatus . |
ExitStatus |
addExitDescription(java.lang.Throwable throwable)
Extract the stack trace from the throwable provided and append it to
the exist description.
|
ExitStatus |
and(ExitStatus status)
Create a new
ExitStatus with a logical combination of the exit
code, and a concatenation of the descriptions. |
int |
compareTo(ExitStatus status) |
boolean |
equals(java.lang.Object obj)
Compare the fields one by one.
|
java.lang.String |
getExitCode()
Getter for the exit code (defaults to blank).
|
java.lang.String |
getExitDescription()
Getter for the exit description (defaults to blank)
|
int |
hashCode()
Compatible with the equals implementation.
|
static boolean |
isNonDefaultExitStatus(ExitStatus status) |
boolean |
isRunning()
Check if this status represents a running process.
|
ExitStatus |
replaceExitCode(java.lang.String code)
Add an exit code to an existing
ExitStatus . |
java.lang.String |
toString() |
public static final ExitStatus UNKNOWN
public static final ExitStatus EXECUTING
public static final ExitStatus COMPLETED
public static final ExitStatus NOOP
public static final ExitStatus FAILED
public static final ExitStatus STOPPED
public ExitStatus(java.lang.String exitCode)
public ExitStatus(java.lang.String exitCode, java.lang.String exitDescription)
public java.lang.String getExitCode()
public java.lang.String getExitDescription()
String
containing the exit description.public ExitStatus and(ExitStatus status)
ExitStatus
with a logical combination of the exit
code, and a concatenation of the descriptions. If either value has a
higher severity then its exit code will be used in the result. In the
case of equal severity, the exit code is replaced if the new value is
alphabetically greater.status
- an ExitStatus
to combine with this one.ExitStatus
combining the current value and the
argument provided.public int compareTo(ExitStatus status)
compareTo
in interface java.lang.Comparable<ExitStatus>
status
- an ExitStatus
to compareComparable
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public ExitStatus replaceExitCode(java.lang.String code)
ExitStatus
. If there is already a
code present tit will be replaced.code
- the code to addExitStatus
with the same properties but a new exit
code.public boolean isRunning()
public ExitStatus addExitDescription(java.lang.String description)
ExitStatus
. If there is
already a description present the two will be concatenated with a
semicolon.description
- the description to addExitStatus
with the same properties but a new exit
descriptionpublic ExitStatus addExitDescription(java.lang.Throwable throwable)
throwable
- Throwable
instance containing the stack trace.public static boolean isNonDefaultExitStatus(ExitStatus status)
status
- the exit code to be evaluated