1   /*
2    * SPDX-FileCopyrightText: none
3    * SPDX-License-Identifier: CC0-1.0
4    */
5   
6   package gov.nist.secauto.metaschema.cli.processor;
7   
8   import edu.umd.cs.findbugs.annotations.NonNull;
9   import edu.umd.cs.findbugs.annotations.Nullable;
10  
11  public interface ExitStatus {
12    /**
13     * Get the exit code information associated with this exit status.
14     *
15     * @return the exit code information
16     */
17    @NonNull
18    ExitCode getExitCode();
19  
20    @Nullable
21    Throwable getThrowable();
22  
23    /**
24     * Process the exit status.
25     *
26     * @param showStackTrace
27     *          include the stack trace for the throwable, if associated
28     * @see #withThrowable(Throwable)
29     */
30    void generateMessage(boolean showStackTrace);
31  
32    /**
33     * Associate a throwable with the exit status.
34     *
35     * @param throwable
36     *          the throwable
37     * @return this exit status
38     */
39    @NonNull
40    ExitStatus withThrowable(@NonNull Throwable throwable);
41  }