public class Failure
extends java.lang.Object
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()
Modifier and Type | Field and Description |
---|---|
private java.lang.Object |
descriptor |
private java.util.List<Fix> |
fixes |
private java.lang.String |
message |
private Node |
node |
private ValidationRuleAction |
rule |
Constructor and Description |
---|
Failure(ValidationRuleAction rule,
Node node)
Create a new validation failure.
|
Failure(ValidationRuleAction rule,
Node node,
java.lang.String message)
Create a new validation failure with a detailed message.
|
Failure(ValidationRuleAction rule,
Node node,
java.lang.String message,
Fix... fixes)
Create a new validation failure with a detailed message and a list
of suggested fixes.
|
Modifier and Type | Method and Description |
---|---|
void |
addFix(Fix fix)
Add a suggested fix to this failure.
|
boolean |
equals(java.lang.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.
|
java.lang.Object |
getDescriptor() |
java.util.List<Fix> |
getFixes()
Get a list of suggested fixes.
|
java.lang.String |
getMessage()
Get a message explaining the failure.
|
Node |
getNode()
Get the node that failed validation.
|
ValidationRuleAction |
getValidator()
Get the validation rule that failed.
|
int |
hashCode() |
void |
setDescriptor(java.lang.Object descriptor)
Set a descriptor on this failure.
|
java.lang.String |
toString() |
private ValidationRuleAction rule
private Node node
private java.lang.String message
private java.util.List<Fix> fixes
private java.lang.Object descriptor
public Failure(ValidationRuleAction rule, Node node)
rule
- The validation rule that failsnode
- The node that contains the failurepublic Failure(ValidationRuleAction rule, Node node, java.lang.String message)
rule
- 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(ValidationRuleAction rule, Node node, java.lang.String message, Fix... fixes)
rule
- 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 fixespublic void setDescriptor(java.lang.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 positions on physical bioassays.
descriptor
- Any objectpublic java.lang.Object getDescriptor()
setDescriptor(Object)
public ValidationRuleAction getValidator()
public Node getNode()
public java.lang.String getMessage()
public java.util.List<Fix> getFixes()
public void addFix(Fix fix)
fix
- The fix to add.public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object