001/*
002 * SPDX-FileCopyrightText: none
003 * SPDX-License-Identifier: CC0-1.0
004 */
005
006package gov.nist.secauto.metaschema.cli.processor;
007
008import org.apache.commons.cli.Option;
009import org.apache.commons.cli.ParseException;
010
011import edu.umd.cs.findbugs.annotations.NonNull;
012import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
013
014public class InvalidArgumentException
015    extends ParseException {
016
017  /**
018   * the serial version UID.
019   */
020  private static final long serialVersionUID = 1L;
021
022  /** The option that had the invalid argument. */
023  private Option option;
024
025  /**
026   * Generate a new exception.
027   *
028   * @param message
029   *          the message
030   */
031  public InvalidArgumentException(String message) {
032    super(message);
033  }
034
035  /**
036   * Return the option requiring an argument that wasn't provided on the command
037   * line.
038   *
039   * @return the related option
040   */
041  @SuppressFBWarnings(value = "EI_EXPOSE_REP", justification = "intended to expose option for error handling")
042  public Option getOption() {
043    return option;
044  }
045
046  /**
047   * Assign the option requiring an argument that wasn't provided on the command
048   * line.
049   *
050   * @param option
051   *          the option to set
052   */
053  @SuppressFBWarnings(value = "EI_EXPOSE_REP2", justification = "intended to expose option for error handling")
054  public void setOption(@NonNull Option option) {
055    this.option = option;
056  }
057}