public static enum ProgramExecutionResult.Status extends Enum<ProgramExecutionResult.Status>
can have.
A program can use this to determine its own return status code. Both status OK and WARNING means
that a program's execution is successful, even if a WARNING status tells that the user may have to
check the outputs and/or the warning messages issued by the program.| Enum Constant and Description |
|---|
ERROR
Status ERROR means that at least an error has been signaled with
ProgramExecutionResult.addError(String). |
OK
Status OK means that neither
ProgramExecutionResult.addWarning(String) nor ProgramExecutionResult.addError(String) have been called |
TERMINATED
Status TERMINATED is a special one in that it is not set by any method but
forceStatus(Status.TERMINATED) |
WARNING
Status WARNING means that at least a warning has been signaled with
ProgramExecutionResult.addWarning(String), but that
no errors have been signaled. |
| Modifier and Type | Method and Description |
|---|---|
int |
exitStatus()
Returns the exit status corresponding to this status.
|
static ProgramExecutionResult.Status |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ProgramExecutionResult.Status[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ProgramExecutionResult.Status OK
ProgramExecutionResult.addWarning(String) nor ProgramExecutionResult.addError(String) have been calledpublic static final ProgramExecutionResult.Status WARNING
ProgramExecutionResult.addWarning(String), but that
no errors have been signaled.public static final ProgramExecutionResult.Status ERROR
ProgramExecutionResult.addError(String).public static final ProgramExecutionResult.Status TERMINATED
forceStatus(Status.TERMINATED)public static ProgramExecutionResult.Status[] values()
for (ProgramExecutionResult.Status c : ProgramExecutionResult.Status.values()) System.out.println(c);
public static ProgramExecutionResult.Status valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic int exitStatus()
OK and status represents a successful execution, hence the return code is 0
(zero),
ERROR returns 1,
TERMINATED return 2.OK and WARNING, 1 for ERROR and 2 for TERMINATED.Copyright © 2013–2021 Sébastien Bigaret, Patrick Meyer. All rights reserved.