Package net.sf.basedb.util.overview
Class Failure
java.lang.Object
net.sf.basedb.util.overview.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).
- Version:
- 2.2
- Author:
- Nicklas
- See Also:
- Last modified
- $Date: 2012-09-14 09:28:35 +0200 (fr, 14 sep 2012) $
-
Field Summary
-
Constructor Summary
ConstructorDescriptionFailure
(ValidationRuleAction rule, Node node) Create a new validation failure.Failure
(ValidationRuleAction rule, Node node, String message) Create a new validation failure with a detailed message.Failure
(ValidationRuleAction rule, Node node, String message, Fix... fixes) Create a new validation failure with a detailed message and a list of suggested fixes. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a suggested fix to this failure.boolean
One failure is the same as another if they have the same validator but different nodes referencing the same item with equal descriptors.getFixes()
Get a list of suggested fixes.Get a message explaining the failure.getNode()
Get the node that failed validation.Get the validation rule that failed.int
hashCode()
void
setDescriptor
(Object descriptor) Set a descriptor on this failure.toString()
-
Field Details
-
rule
-
node
-
message
-
fixes
-
descriptor
-
-
Constructor Details
-
Failure
Create a new validation failure.- Parameters:
rule
- The validation rule that failsnode
- The node that contains the failure
-
Failure
Create a new validation failure with a detailed message.- Parameters:
rule
- The validation rule that failsnode
- The node that contains the failuremessage
- A detailed message about the failue, if null theValidator.getFailureSummary()
is used
-
Failure
Create a new validation failure with a detailed message and a list of suggested fixes.- Parameters:
rule
- The validation rule that failsnode
- The node that contains the failuremessage
- A detailed message about the failue, if null theValidator.getFailureSummary()
is usedfixes
- A list of suggested fixes
-
-
Method Details
-
setDescriptor
Set a descriptor on this failure. This affects theequals(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.
- Parameters:
descriptor
- Any object- Since:
- 2.6
-
getDescriptor
- Returns:
- The descriptor
- Since:
- 2.6
- See Also:
-
getValidator
Get the validation rule that failed.- Since:
- 3.2
-
getNode
Get the node that failed validation. -
getMessage
Get a message explaining the failure. -
getFixes
Get a list of suggested fixes.- Returns:
- A list of suggested fixes, or null if there are none
-
addFix
Add a suggested fix to this failure.- Parameters:
fix
- The fix to add.
-
toString
-
equals
One failure is the same as another if they have the same validator but different nodes referencing the same item with equal descriptors. -
hashCode
public int hashCode()
-