Class ExitStatus
java.lang.Object
org.springframework.boot.cli.command.status.ExitStatus
Encapsulation of the outcome of a command.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ExitStatusGeneric "not OK" exit status with non-zero exit code and hangup=true.static final ExitStatusGeneric "OK" exit status with zero exit code and hangup=false. -
Constructor Summary
ConstructorsConstructorDescriptionExitStatus(int code, String name) Create a newExitStatusinstance.ExitStatus(int code, String name, boolean hangup) Create a newExitStatusinstance. -
Method Summary
-
Field Details
-
OK
Generic "OK" exit status with zero exit code and hangup=false. -
ERROR
Generic "not OK" exit status with non-zero exit code and hangup=true.
-
-
Constructor Details
-
ExitStatus
Create a newExitStatusinstance.- Parameters:
code- the exit codename- the name
-
ExitStatus
Create a newExitStatusinstance.- Parameters:
code- the exit codename- the namehangup- true if it is OK for the caller to hangup
-
-
Method Details
-
getCode
public int getCode()An exit code appropriate for use inSystem.exit().- Returns:
- an exit code
-
getName
A name describing the outcome.- Returns:
- a name
-
isHangup
public boolean isHangup()Flag to signal that the caller can (or should) hangup. A server process with non-daemon threads should set this to false.- Returns:
- the flag
-
hangup
Convert the existing code to a hangup.- Returns:
- a new ExitStatus with hangup=true
-
toString
-