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 org.apache.commons.cli.Option;
9   import org.apache.commons.cli.ParseException;
10  
11  import edu.umd.cs.findbugs.annotations.NonNull;
12  import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
13  
14  public class InvalidArgumentException
15      extends ParseException {
16  
17    /**
18     * the serial version UID.
19     */
20    private static final long serialVersionUID = 1L;
21  
22    /** The option that had the invalid argument. */
23    private Option option;
24  
25    /**
26     * Generate a new exception.
27     *
28     * @param message
29     *          the message
30     */
31    public InvalidArgumentException(String message) {
32      super(message);
33    }
34  
35    /**
36     * Return the option requiring an argument that wasn't provided on the command
37     * line.
38     *
39     * @return the related option
40     */
41    @SuppressFBWarnings(value = "EI_EXPOSE_REP", justification = "intended to expose option for error handling")
42    public Option getOption() {
43      return option;
44    }
45  
46    /**
47     * Assign the option requiring an argument that wasn't provided on the command
48     * line.
49     *
50     * @param option
51     *          the option to set
52     */
53    @SuppressFBWarnings(value = "EI_EXPOSE_REP2", justification = "intended to expose option for error handling")
54    public void setOption(@NonNull Option option) {
55      this.option = option;
56    }
57  }