com.mcdermottroe.exemplar.ui.cli
Class ExitStatus

java.lang.Object
  extended by com.mcdermottroe.exemplar.ui.cli.ExitStatus

public final class ExitStatus
extends Object

A class to wrap and explain exit status codes produced by the CLI UI.

Since:
0.1

Field Summary
private static Set<ExitCode> exitCodes
          The stash of all known exit codes.
 
Constructor Summary
private ExitStatus()
          Private constructor to prevent instantiation of this class.
 
Method Summary
static int getExitCode(String mnemonic)
          Convert a mnemonic exit code to an integer suitable for returning to the calling shell.
static Set<ExitCode> getExitCodes()
          Get all of the exit codes.
private static void initialise()
          Initialisation routine to pull the exit codes out of the JAR and load them into the stash.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

exitCodes

private static Set<ExitCode> exitCodes
The stash of all known exit codes.

Constructor Detail

ExitStatus

private ExitStatus()
Private constructor to prevent instantiation of this class.

Method Detail

initialise

private static void initialise()
Initialisation routine to pull the exit codes out of the JAR and load them into the stash.


getExitCode

public static int getExitCode(String mnemonic)
Convert a mnemonic exit code to an integer suitable for returning to the calling shell.

Parameters:
mnemonic - The mnemonic String for the exit code.
Returns:
An integer exit code or -1 if an error occurs.

getExitCodes

public static Set<ExitCode> getExitCodes()
Get all of the exit codes.

Returns:
A copy of the Set of exit codes.