Class AmbiguousOptionException

  • All Implemented Interfaces:
    java.io.Serializable

    public class AmbiguousOptionException
    extends UnrecognizedOptionException
    Exception thrown when an option can't be identified from a partial name.
    Since:
    1.3
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Collection<java.lang.String> matchingOptions
      The list of options matching the partial name specified
      private static long serialVersionUID
      This exception serialVersionUID.
    • Constructor Summary

      Constructors 
      Constructor Description
      AmbiguousOptionException​(java.lang.String option, java.util.Collection<java.lang.String> matchingOptions)
      Constructs a new AmbiguousOptionException.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static java.lang.String createMessage​(java.lang.String option, java.util.Collection<java.lang.String> matchingOptions)
      Build the exception message from the specified list of options.
      java.util.Collection<java.lang.String> getMatchingOptions()
      Gets the options matching the partial name.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        This exception serialVersionUID.
        See Also:
        Constant Field Values
      • matchingOptions

        private final java.util.Collection<java.lang.String> matchingOptions
        The list of options matching the partial name specified
    • Constructor Detail

      • AmbiguousOptionException

        public AmbiguousOptionException​(java.lang.String option,
                                        java.util.Collection<java.lang.String> matchingOptions)
        Constructs a new AmbiguousOptionException.
        Parameters:
        option - the partial option name
        matchingOptions - the options matching the name
    • Method Detail

      • createMessage

        private static java.lang.String createMessage​(java.lang.String option,
                                                      java.util.Collection<java.lang.String> matchingOptions)
        Build the exception message from the specified list of options.
        Parameters:
        option -
        matchingOptions -
        Returns:
      • getMatchingOptions

        public java.util.Collection<java.lang.String> getMatchingOptions()
        Gets the options matching the partial name.
        Returns:
        a collection of options matching the name