|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.util.overview.Failure
public class Failure
Holds information about a failed validation. Note that all
rules are always validated. Use a ValidationOptions
object to keep track of which validators that should be
ignored, generate warnings or errors.
NOTE! The implementation of the equals(Object)
method of
this object is a bit unorthodox. Two failures are considered equal
if they have the same validator but different nodes referencing the
same item with the same descriptor. Two failures on the same node
are never equal. This allows us to filter out duplicate failures that
happens because there can be several ways to reach a certain item (for
example a reference sample that is used on all hybridizations).
Validator
,
ValidationOptions
,
GenericOverview.getFailures()
,
GenericOverview.getValidationOptions()
Field Summary | |
---|---|
private Object |
descriptor
|
private List<Fix> |
fixes
|
private String |
message
|
private Node |
node
|
private Validator |
validator
|
Constructor Summary | |
---|---|
Failure(Validator validator,
Node node)
Create a new validation failure. |
|
Failure(Validator validator,
Node node,
String message)
Create a new validation failure with a detailed message. |
|
Failure(Validator validator,
Node node,
String message,
Fix... fixes)
Create a new validation failure with a detailed message and a list of suggested fixes. |
Method Summary | |
---|---|
void |
addFix(Fix fix)
Add a suggested fix to this failure. |
boolean |
equals(Object o)
One failure is the same as another if they have the same validator but different nodes referencing the same item with equal descriptors. |
Object |
getDescriptor()
|
List<Fix> |
getFixes()
Get a list of suggested fixes. |
String |
getMessage()
Get a message explaining the failure. |
Node |
getNode()
Get the node that failed validation. |
Validator |
getValidator()
Get the validation rule that failed. |
int |
hashCode()
|
void |
setDescriptor(Object descriptor)
Set a descriptor on this failure. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private Validator validator
private Node node
private String message
private List<Fix> fixes
private Object descriptor
Constructor Detail |
---|
public Failure(Validator validator, Node node)
validator
- The validation rule that failsnode
- The node that contains the failurepublic Failure(Validator validator, Node node, String message)
validator
- The validation rule that failsnode
- The node that contains the failuremessage
- A detailed message about the failue, if null
the Validator.getFailureSummary()
is usedpublic Failure(Validator validator, Node node, String message, Fix... fixes)
validator
- The validation rule that failsnode
- The node that contains the failuremessage
- A detailed message about the failue, if null
the Validator.getFailureSummary()
is usedfixes
- A list of suggested fixesMethod Detail |
---|
public void setDescriptor(Object descriptor)
equals(Object)
method, since the descriptor must be equal for two failures to be
equal.
NOTE! The main reason for this property is that we need to discriminate between failures on different sub-arrays on hybridizations.
descriptor
- Any objectpublic Object getDescriptor()
setDescriptor(Object)
public Validator getValidator()
public Node getNode()
public String getMessage()
public List<Fix> getFixes()
public void addFix(Fix fix)
fix
- The fix to add.public String toString()
toString
in class Object
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |