org.apache.cayenne.validation
Class ValidationResult

java.lang.Object
  extended by org.apache.cayenne.validation.ValidationResult
All Implemented Interfaces:
java.io.Serializable

public class ValidationResult
extends java.lang.Object
implements java.io.Serializable

Represents a result of a validation execution. Contains a set of ValidationFailuresthat occured in a given context. All failures are kept in the same order they were added.

Since:
1.1
Author:
Fabricio Voznika
See Also:
Serialized Form

Constructor Summary
ValidationResult()
           
 
Method Summary
 void addFailure(ValidationFailure failure)
          Add a failure to the validation result.
 java.util.List getFailures()
          Returns all failures added to this result, or empty list is result has no failures.
 java.util.List getFailures(java.lang.Object source)
          Returns all failures related to the source object, or an empty list if there are no such failures.
 boolean hasFailures()
          Returns true if at least one failure has been added to this result.
 boolean hasFailures(java.lang.Object source)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValidationResult

public ValidationResult()
Method Detail

addFailure

public void addFailure(ValidationFailure failure)
Add a failure to the validation result.

Parameters:
failure - failure to be added. It may not be null.
See Also:
ValidationFailure

getFailures

public java.util.List getFailures()
Returns all failures added to this result, or empty list is result has no failures.


getFailures

public java.util.List getFailures(java.lang.Object source)
Returns all failures related to the source object, or an empty list if there are no such failures.

Parameters:
source - it may be null.
See Also:
ValidationFailure.getSource()

hasFailures

public boolean hasFailures()
Returns true if at least one failure has been added to this result. False otherwise.


hasFailures

public boolean hasFailures(java.lang.Object source)
Parameters:
source - it may be null.
Returns:
true if there is at least one failure for source. False otherwise.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2001-2006 Apache.org All Rights Reserved.