public static class ValidationResult.ValidationError
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.lang.Throwable |
cause
The underlying cause if the ValidationError was caused by a Throwable.
|
private java.lang.String |
details
Error details
|
private java.lang.String |
errorCode
Error identifier.
|
private boolean |
isWarning
false: this error can't be ignored; true: this error can be ignored
|
private java.lang.Integer |
pageNumber
The page number on which the error happened, if known.
|
private java.lang.Throwable |
t
Always record the place in the source code where the ValidationError
was created, in case the ValidationError was not caused by a
Throwable.
|
Constructor and Description |
---|
ValidationError(java.lang.String errorCode)
Create a validation error with the given error code
|
ValidationError(java.lang.String errorCode,
java.lang.String details)
Create a validation error with the given error code and the error
explanation.
|
ValidationError(java.lang.String errorCode,
java.lang.String details,
java.lang.Throwable cause)
Create a validation error with the given error code and the error
explanation.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
java.lang.Throwable |
getCause()
Get the underlying cause if the ValidationError was caused by a
Throwable.
|
java.lang.String |
getDetails() |
java.lang.String |
getErrorCode() |
java.lang.Integer |
getPageNumber()
Returns the page number, or null if not known.
|
java.lang.Throwable |
getThrowable()
Get the place where the ValidationError was created, useful if the
ValidationError was not caused by a Throwable.
|
int |
hashCode() |
boolean |
isWarning() |
void |
setDetails(java.lang.String details)
Set the error explanation
|
void |
setPageNumber(java.lang.Integer pageNumber)
Sets or resets the page number.
|
void |
setWarning(boolean isWarning) |
private java.lang.String errorCode
private java.lang.String details
private boolean isWarning
private java.lang.Throwable t
private java.lang.Throwable cause
private java.lang.Integer pageNumber
public ValidationError(java.lang.String errorCode)
errorCode
- public ValidationError(java.lang.String errorCode, java.lang.String details, java.lang.Throwable cause)
errorCode
- the error codedetails
- the error explanationcause
- the error causepublic ValidationError(java.lang.String errorCode, java.lang.String details)
errorCode
- the error codedetails
- the error explanationpublic java.lang.Throwable getThrowable()
public java.lang.Throwable getCause()
public java.lang.Integer getPageNumber()
public void setPageNumber(java.lang.Integer pageNumber)
pageNumber
- zero based page number or null if none is known.public java.lang.String getErrorCode()
public java.lang.String getDetails()
public void setDetails(java.lang.String details)
details
- public boolean isWarning()
public void setWarning(boolean isWarning)
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object