类 ExitStatus
- java.lang.Object
- org.springframework.boot.cli.command.status.ExitStatus
public final class ExitStatus extends Object
Encapsulation of the outcome of a command.
字段概要
字段 修饰符和类型 字段 说明 static ExitStatus
ERROR
Generic "not OK" exit status with non-zero exit code and hangup=true.static ExitStatus
OK
Generic "OK" exit status with zero exit code and hangup=false.
构造器概要
构造器 构造器 说明 ExitStatus(int code, String name)
Create a newExitStatus
instance.ExitStatus(int code, String name, boolean hangup)
Create a newExitStatus
instance.
字段详细资料
OK
public static final ExitStatus OK
Generic "OK" exit status with zero exit code and hangup=false.
ERROR
public static final ExitStatus ERROR
Generic "not OK" exit status with non-zero exit code and hangup=true.
构造器详细资料
ExitStatus
public ExitStatus(int code, String name)
Create a newExitStatus
instance.- 参数:
code
- the exit codename
- the name
ExitStatus
public ExitStatus(int code, String name, boolean hangup)
Create a newExitStatus
instance.- 参数:
code
- the exit codename
- the namehangup
- true if it is OK for the caller to hangup
方法详细资料
getCode
public int getCode()
An exit code appropriate for use inSystem.exit()
.- 返回:
- an exit code
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.- 返回:
- the flag
hangup
public ExitStatus hangup()
Convert the existing code to a hangup.- 返回:
- a new ExitStatus with hangup=true