io.vertx.core.cli

## Class InvalidValueException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.lang.RuntimeException
      - - io.vertx.core.cli.CLIException
        - - io.vertx.core.cli.InvalidValueException

- All Implemented Interfaces:
    Serializable

      public class InvalidValueException
      extends CLIException

  Exception thrown when an option or an argument receives an invalid value.
  Author:
    Clement Escoffier
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `InvalidValueException(Argument argument, String value, Exception cause)` Creates a new instance of `InvalidValueException` for the given argument and the given value.
    `InvalidValueException(Option option, String value)` Creates a new instance of `InvalidValueException` for the given option and the given value.
    `InvalidValueException(Option option, String value, Exception cause)` Creates a new instance of `InvalidValueException` for the given option and the given value.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Argument` | `getArgument()`
    `Option` | `getOption()`
    `String` | `getValue()`

    - ### 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`

- - ### Constructor Detail

    - #### InvalidValueException

          public InvalidValueException(Option option,
                                       String value)

      Creates a new instance of `InvalidValueException` for the given option and the given value. This constructor is used when the option receives a value while it does not accept another value.
      Parameters:
        `option` - the option
        `value` - the value

    - #### InvalidValueException

          public InvalidValueException(Argument argument,
                                       String value,
                                       Exception cause)

      Creates a new instance of `InvalidValueException` for the given argument and the given value. This constructor is used when the argument receives a value that cannot be "converted" to the desired type.
      Parameters:
        `argument` - the argument
        `value` - the value
        `cause` - the cause

    - #### InvalidValueException

          public InvalidValueException(Option option,
                                       String value,
                                       Exception cause)

      Creates a new instance of `InvalidValueException` for the given option and the given value. This constructor is used when the options receives a value that cannot be "converted" to the desired type.
      Parameters:
        `option` - the option
        `value` - the value
        `cause` - the cause

  - ### Method Detail

    - #### getOption

          public Option getOption()

      Returns:
        the option, may be `null` if the exception is about an argument.

    - #### getValue

          public String getValue()

      Returns:
        the invalid value.

    - #### getArgument

          public Argument getArgument()

      Returns:
        the argument, may be `null` if the exception is about an option.

Copyright © 2021 Eclipse. All rights reserved.