java.lang.Object
org.springframework.boot.cli.command.status.ExitStatus

public final class ExitStatus extends Object
Encapsulation of the outcome of a command.
Since:
1.0.0
Author:
Dave Syer
See Also:
  • Field Details

    • 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.
  • Constructor Details

    • ExitStatus

      public ExitStatus(int code, String name)
      Create a new ExitStatus instance.
      Parameters:
      code - the exit code
      name - the name
    • ExitStatus

      public ExitStatus(int code, String name, boolean hangup)
      Create a new ExitStatus instance.
      Parameters:
      code - the exit code
      name - the name
      hangup - true if it is OK for the caller to hangup
  • Method Details

    • getCode

      public int getCode()
      An exit code appropriate for use in System.exit().
      Returns:
      an exit code
    • getName

      public String 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

      public ExitStatus hangup()
      Convert the existing code to a hangup.
      Returns:
      a new ExitStatus with hangup=true
    • toString

      public String toString()
      Overrides:
      toString in class Object