Package com.atlassian.sal.api.validate
Class ValidationResult
java.lang.Object
com.atlassian.sal.api.validate.ValidationResult
The outcome of a validation check.
- Since:
- 3.0
-
Method Summary
Modifier and TypeMethodDescriptionReturns error messages.Returns warnings messages.booleanReturn true if the validation added error messages.booleanReturn true if the validation added warning messages.booleanisValid()Return true if the validation passed, false if there were errors.static ValidationResultvalid()static ValidationResultwithErrorAndWarningMessages(Iterable<String> errorMessages, Iterable<String> warningMessages) static ValidationResultwithErrorMessages(Iterable<String> errorMessages) static ValidationResultwithWarningMessages(Iterable<String> warningMessages)
-
Method Details
-
valid
-
withErrorMessages
-
withWarningMessages
-
withErrorAndWarningMessages
-
isValid
public boolean isValid()Return true if the validation passed, false if there were errors. (Note warnings do not cause this method to return false).- Returns:
- true if the validation passed, false if there were errors.
- See Also:
-
hasErrors
public boolean hasErrors()Return true if the validation added error messages.- Returns:
- true if the validation failed with error messages.
-
hasWarnings
public boolean hasWarnings()Return true if the validation added warning messages.- Returns:
- true if the validation failed with warning messages.
-
getErrorMessages
Returns error messages.These should normally be localised to the end user's locale. This will never be null, but may be empty.
- Returns:
- validation error messages, could be empty but not null.
-
getWarningMessages
Returns warnings messages.These should normally be localised to the end user's locale. This will never be null, but may be empty.
- Returns:
- validation warning messages, could be empty but not null.
-