public class ValidationResult extends Object
Validatable.validate()| Modifier and Type | Field and Description |
|---|---|
protected LinkedList<ValidationResult> |
resultList |
| Constructor and Description |
|---|
ValidationResult(ValidationType type)
Creates ValidationResult of the given type.
|
ValidationResult(ValidationType type,
String id,
String description,
Date validationDate)
Creates ValidationResult of the given type.
|
| Modifier and Type | Method and Description |
|---|---|
ValidationResult |
addResult(ValidationResult result)
Adds a child validation result of the given type to the result.
|
ValidationResult |
addResult(ValidationType type)
Creates and adds a new child validation result of the given type to the result.
|
void |
checkFailed(String reason)
Adds reason message to the result and sets the result validationStatus to
ValidationStatus.FAILED. |
void |
checkNotChecked(String reason)
Adds reason message to the result and sets the result status to
ValidationStatus.UNCHECKED. |
void |
checkPassed()
Sets the result status to
ValidationStatus.PASSED if status is null. |
String |
getDescription()
Returns description of the validation result.
|
String |
getId()
Returns id of the result.
|
String[] |
getReasons()
Returns an array of failure reason messages of the result.
|
ValidationResult[] |
getResults()
Returns an array of child results contained by the result.
|
SignatureValidationResult |
getSignatureResult(String signatureId)
Finds and returns signature's validation result by the specified signature ID.
|
ValidationStatus |
getStatus()
Returns status of the validation result.
|
ValidationType |
getType()
Returns type of the validation result.
|
Date |
getValidationDate()
Returns the time when the validation was performed.
|
void |
setDescription(String description)
Sets description of the validation result.
|
String |
toString() |
protected final LinkedList<ValidationResult> resultList
public ValidationResult(ValidationType type)
type - type of the result.public ValidationResult(ValidationType type, String id, String description, Date validationDate)
type - type of the result.id - identifier of the validation result.description - description of the validation result.validationDate - validation time.public ValidationResult addResult(ValidationType type)
type - type of the result.public ValidationResult addResult(ValidationResult result)
result - child result.public ValidationType getType()
public ValidationStatus getStatus()
public SignatureValidationResult getSignatureResult(String signatureId)
signatureId - Signature's ID.null if result by signature ID was not found.public void checkPassed()
ValidationStatus.PASSED if status is null.public void checkNotChecked(String reason)
ValidationStatus.UNCHECKED.reason - reason message.public void checkFailed(String reason)
ValidationStatus.FAILED.reason - reason message.public String getId()
public String getDescription()
public void setDescription(String description)
description - description of the validation result.public Date getValidationDate()
public ValidationResult[] getResults()
public String[] getReasons()