Class AbstractExitStatus
- java.lang.Object
-
- gov.nist.secauto.metaschema.cli.processor.AbstractExitStatus
-
- All Implemented Interfaces:
ExitStatus
- Direct Known Subclasses:
MessageExitStatus,NonMessageExitStatus
public abstract class AbstractExitStatus extends Object implements ExitStatus
-
-
Constructor Summary
Constructors Constructor Description AbstractExitStatus(ExitCode exitCode)Construct a new exit status based on the providedexitCode.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidgenerateMessage(boolean showStackTrace)Process the exit status.ExitCodegetExitCode()Get the exit code information associated with this exit status.protected abstract StringgetMessage()Get the associated message.ThrowablegetThrowable()Get the associated throwable.ExitStatuswithThrowable(Throwable throwable)Associate a throwable with the exit status.
-
-
-
Constructor Detail
-
AbstractExitStatus
public AbstractExitStatus(@NonNull ExitCode exitCode)
Construct a new exit status based on the providedexitCode.- Parameters:
exitCode- the exit code
-
-
Method Detail
-
getExitCode
public ExitCode getExitCode()
Description copied from interface:ExitStatusGet the exit code information associated with this exit status.- Specified by:
getExitCodein interfaceExitStatus- Returns:
- the exit code information
-
getThrowable
public Throwable getThrowable()
Get the associated throwable.- Specified by:
getThrowablein interfaceExitStatus- Returns:
- the throwable or
null
-
withThrowable
public ExitStatus withThrowable(@NonNull Throwable throwable)
Description copied from interface:ExitStatusAssociate a throwable with the exit status.- Specified by:
withThrowablein interfaceExitStatus- Parameters:
throwable- the throwable- Returns:
- this exit status
-
getMessage
@Nullable protected abstract String getMessage()
Get the associated message.- Returns:
- the message or
null
-
generateMessage
public void generateMessage(boolean showStackTrace)
Description copied from interface:ExitStatusProcess the exit status.- Specified by:
generateMessagein interfaceExitStatus- Parameters:
showStackTrace- include the stack trace for the throwable, if associated- See Also:
ExitStatus.withThrowable(Throwable)
-
-