public class SimpleValidationResult extends Object implements ValidationResult
| Modifier and Type | Class and Description |
|---|---|
static class |
SimpleValidationResult.Builder |
| Modifier and Type | Field and Description |
|---|---|
static ValidationResult |
FORBIDDEN
A singleton unauthorized result.
|
static ValidationResult |
VALID
A singleton valid result.
|
| Modifier and Type | Method and Description |
|---|---|
static SimpleValidationResult.Builder |
builder() |
ServiceException |
convertToServiceException(String errorMsg) |
Collection<ValidationError> |
getErrors() |
boolean |
isAuthorized() |
boolean |
isValid() |
ServiceException |
throwIfInvalid()
converts this validation result into an Exception and throws it
|
ServiceException |
throwIfInvalid(String message)
converts this validation result into an Exception and throws it
|
String |
toString() |
public static final ValidationResult VALID
public static final ValidationResult FORBIDDEN
public boolean isAuthorized()
isAuthorized in interface ValidationResultpublic boolean isValid()
isValid in interface ValidationResultpublic Collection<ValidationError> getErrors()
getErrors in interface ValidationResultpublic ServiceException throwIfInvalid(String message) throws ServiceException
ValidationResultthrowIfInvalid in interface ValidationResultServiceExceptionpublic ServiceException throwIfInvalid() throws ServiceException
ValidationResultfirst validation error will be used as message string
throwIfInvalid in interface ValidationResultAll implementations do not conform to specifications and return null. Either the implementation or the javadoc needs to be updated.
ServiceExceptionpublic ServiceException convertToServiceException(String errorMsg)
public static SimpleValidationResult.Builder builder()
Copyright © 2003–2016 Atlassian. All rights reserved.