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
-
-
Constructor Summary
Constructors Constructor Description SimpleValidationFailure(Object source, Object error)
-
Method Summary
All Methods Instance Methods Concrete Methods 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.
-
-
-
Method Detail
-
getDescription
public String getDescription()
Returns the error converted to String.- Specified by:
getDescription
in interfaceValidationFailure
-
getSource
public Object getSource()
Returns object that failed the validation.- Specified by:
getSource
in interfaceValidationFailure
- 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 interfaceValidationFailure
-
-