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 StringgetDescription()Returns the error converted to String.ObjectgetError()Returns an user defined error object.ObjectgetSource()Returns object that failed the validation.StringtoString()Returns a String representation of the failure.
-
-
-
Method Detail
-
getDescription
public String getDescription()
Returns the error converted to String.- Specified by:
getDescriptionin interfaceValidationFailure
-
getSource
public Object getSource()
Returns object that failed the validation.- Specified by:
getSourcein interfaceValidationFailure- Returns:
- the failure's source or null in case a source cannot be defined.
-
getError
public Object getError()
Description copied from interface:ValidationFailureReturns an user defined error object.- Specified by:
getErrorin interfaceValidationFailure
-
-