public class ValidatorResult
extends java.lang.Object
The ValidatorResult
class is a container intended to be used
by validation methods that return both errors and warnings.
Constructor and Description |
---|
ValidatorResult() |
Modifier and Type | Method and Description |
---|---|
void |
addError(java.lang.String key,
java.lang.Object... args)
Add a ValidatorError to the list of errors.
|
void |
addError(ValidatorError error)
Add a ValidatorError to the list of errors.
|
void |
addWarning(java.lang.String key,
java.lang.Object... args)
Add a ValidatorWarning to the list of warnings.
|
void |
addWarning(ValidatorWarning warning)
Add a ValidatorWarning to the list of warnings.
|
void |
append(ValidatorResult result)
Appends the results of the passed in ValidatorResult
to this result
|
java.util.List<ValidatorError> |
getErrors()
Retrieve the list of ValidatorErrors.
|
java.lang.String |
getMessage() |
java.util.List<ValidatorWarning> |
getWarnings()
Retrieve the list of ValidatorWarnings.
|
boolean |
hasErrors() |
boolean |
isEmpty() |
public void addError(ValidatorError error)
error
- ValidatorError to be added.public void addError(java.lang.String key, java.lang.Object... args)
key
- the message key of the errorargs
- the args that go with the error message.public void addWarning(ValidatorWarning warning)
warning
- ValidatorWarning to be added.public void addWarning(java.lang.String key, java.lang.Object... args)
key
- the message key of the warningargs
- the args that go with the warning.public java.util.List<ValidatorError> getErrors()
public java.util.List<ValidatorWarning> getWarnings()
public void append(ValidatorResult result)
result
- the results to append.public java.lang.String getMessage()
public boolean isEmpty()
public boolean hasErrors()