001/*
002 * SPDX-FileCopyrightText: none
003 * SPDX-License-Identifier: CC0-1.0
004 */
005
006package gov.nist.secauto.metaschema.cli.processor;
007
008import edu.umd.cs.findbugs.annotations.NonNull;
009import edu.umd.cs.findbugs.annotations.Nullable;
010
011public interface ExitStatus {
012  /**
013   * Get the exit code information associated with this exit status.
014   *
015   * @return the exit code information
016   */
017  @NonNull
018  ExitCode getExitCode();
019
020  @Nullable
021  Throwable getThrowable();
022
023  /**
024   * Process the exit status.
025   *
026   * @param showStackTrace
027   *          include the stack trace for the throwable, if associated
028   * @see #withThrowable(Throwable)
029   */
030  void generateMessage(boolean showStackTrace);
031
032  /**
033   * Associate a throwable with the exit status.
034   *
035   * @param throwable
036   *          the throwable
037   * @return this exit status
038   */
039  @NonNull
040  ExitStatus withThrowable(@NonNull Throwable throwable);
041}