com.h3c.util

## Class ValidationException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.lang.RuntimeException
      - - com.h3c.util.ValidationException

- All Implemented Interfaces:
    Serializable

      public class ValidationException
      extends RuntimeException

  This exception is designed to be used with implementations of `AbstractValidator`. It extends `RuntimeException` and holds a list of strings payload, allowing the validator to attach its list of issues to the exception.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ValidationException(String message, AbstractValidator validator)` Constructs a validation exception.
    `ValidationException(String message, AbstractValidator validator, Throwable cause)` Constructs a validation exception.
    `ValidationException(String message, List<String> issues)` Constructs a validation exception.
    `ValidationException(String message, List<String> issues, Throwable cause)` Constructs a validation exception.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `List<String>` | `getIssues()` Returns the list of issues associated with this exception.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Throwable

      `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### ValidationException

          public ValidationException(String message,
                             AbstractValidator validator)

      Constructs a validation exception.
      Parameters:
        `message` - the exception message
        `validator` - the validator throwing the exception

    - #### ValidationException

          public ValidationException(String message,
                             AbstractValidator validator,
                             Throwable cause)

      Constructs a validation exception.
      Parameters:
        `message` - the exception message
        `validator` - the validator throwing the exception
        `cause` - an underlying cause

    - #### ValidationException

          public ValidationException(String message,
                             List<String> issues)

      Constructs a validation exception.
      Parameters:
        `message` - the exception message
        `issues` - the list of validation issues

    - #### ValidationException

          public ValidationException(String message,
                             List<String> issues,
                             Throwable cause)

      Constructs a validation exception.
      Parameters:
        `message` - the exception message
        `issues` - the list of validation issues
        `cause` - an underlying cause

  - ### Method Detail

    - #### getIssues

          public List<String> getIssues()

      Returns the list of issues associated with this exception.
      Returns:
        the list of issues.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Throwable`

Copyright © 2014. All Rights Reserved.