Package org.apache.cayenne.validation

# Class SimpleValidationFailure

java.lang.Object
org.apache.cayenne.validation.SimpleValidationFailure

All Implemented Interfaces:
  `Serializable`, `ValidationFailure`

Direct Known Subclasses:
  `BeanValidationFailure`

public class SimpleValidationFailure extends Object implements ValidationFailure
Represents a generic validation failure that contains failed object and a message describing the failure.

Since:
  1.1
See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected Object`
  `error`
  `protected Object`
  `source`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SimpleValidationFailure(Object source, Object error)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getDescription()`
  Returns the error converted to String.
  `Object`
  `getError()`
  Returns an user defined error object.
  `Object`
  `getSource()`
  Returns object that failed the validation.
  `String`
  `toString()`
  Returns a String representation of the failure.

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

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

- ## Field Details

  - ### source

    protected Object source

  - ### error

    protected Object error

- ## Constructor Details

  - ### SimpleValidationFailure

    public SimpleValidationFailure(Object source, Object error)

- ## Method Details

  - ### getDescription

    public String getDescription()
    Returns the error converted to String.
    Specified by:
      `getDescription` in interface `ValidationFailure`

  - ### getSource

    public Object getSource()
    Returns object that failed the validation.
    Specified by:
      `getSource` in interface `ValidationFailure`
    Returns:
      the failure's source or null in case a source cannot be defined.

  - ### getError

    public Object getError()
    Description copied from interface: `ValidationFailure`
    Returns an user defined error object.
    Specified by:
      `getError` in interface `ValidationFailure`

  - ### toString

    public String toString()
    Returns a String representation of the failure.
    Overrides:
      `toString` in class `Object`