Package org.apache.commons.cli
Class AlreadySelectedException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.apache.commons.cli.ParseException
org.apache.commons.cli.AlreadySelectedException
- All Implemented Interfaces:
Serializable
Thrown when more than one option in an option group has been provided.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final OptionGroup
The option group selected.private final Option
The option that triggered the exception.private static final long
This exceptionserialVersionUID
. -
Constructor Summary
ConstructorsModifierConstructorDescriptionAlreadySelectedException
(String message) Constructs a newAlreadySelectedException
with the specified detail message.private
AlreadySelectedException
(String message, OptionGroup group, Option option) AlreadySelectedException
(OptionGroup group, Option option) Constructs a newAlreadySelectedException
for the specified option group. -
Method Summary
Modifier and TypeMethodDescriptionGets the option that was added to the group and triggered the exception.Gets the option group where another option has been selected.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDThis exceptionserialVersionUID
.- See Also:
-
group
The option group selected. -
option
The option that triggered the exception.
-
-
Constructor Details
-
AlreadySelectedException
Constructs a newAlreadySelectedException
for the specified option group.- Parameters:
group
- the option group already selectedoption
- the option that triggered the exception- Since:
- 1.2
-
AlreadySelectedException
Constructs a newAlreadySelectedException
with the specified detail message.- Parameters:
message
- the detail message
-
AlreadySelectedException
-
-
Method Details
-
getOption
Gets the option that was added to the group and triggered the exception.- Returns:
- the related option
- Since:
- 1.2
-
getOptionGroup
Gets the option group where another option has been selected.- Returns:
- the related option group
- Since:
- 1.2
-