Package org.apache.cayenne.validation
Class ValidationResult
java.lang.Object
org.apache.cayenne.validation.ValidationResult
- All Implemented Interfaces:
Serializable
Represents a result of a validation execution. Contains a set of
ValidationFailures
that occured in a given context. All
failures are kept in the same order they were added.- Since:
- 1.1
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addFailure
(ValidationFailure failure) Add a failure to the validation result.void
clear()
Returns all failures added to this result, or empty list is result has no failures.getFailures
(Object source) Returns all failures related to thesource
object, or an empty list if there are no such failures.boolean
Returns true if at least one failure has been added to this result.boolean
hasFailures
(Object source) toString()
-
Constructor Details
-
ValidationResult
public ValidationResult()
-
-
Method Details
-
addFailure
Add a failure to the validation result.- Parameters:
failure
- failure to be added. It may not be null.- See Also:
-
getFailures
Returns all failures added to this result, or empty list is result has no failures. -
getFailures
Returns all failures related to thesource
object, or an empty list if there are no such failures.- Parameters:
source
- it may be null.- See Also:
-
hasFailures
public boolean hasFailures()Returns true if at least one failure has been added to this result. False otherwise. -
hasFailures
- Parameters:
source
- it may be null.- Returns:
- true if there is at least one failure for
source
. False otherwise.
-
clear
public void clear() -
toString
-