SimpleValidationResult instead.@Deprecated public class CoreValidationResult extends Object implements ValidationResult
ValidationErrors to API ValidationResults.| Modifier and Type | Field and Description |
|---|---|
static CoreValidationResult |
FORBIDDEN
Deprecated.
A singleton unauthorized result.
|
static CoreValidationResult |
VALID
Deprecated.
A singleton valid result.
|
| Modifier and Type | Method and Description |
|---|---|
ServiceException |
convertToServiceException(String errorMsg)
Deprecated.
|
static CoreValidationResult |
create(boolean authorized,
Collection<ValidationError> coreErrors)
Deprecated.
since 5.7, use
CoreValidationResultFactory#create(boolean, java.util.Collection instead. |
static CoreValidationResult |
create(boolean authorized,
List<ValidationError> errors)
Deprecated.
since 5.7, use
SimpleValidationResult.Builder instead |
static CoreValidationResult |
create(boolean authorized,
Message message)
Deprecated.
since 5.7, use
SimpleValidationResult.Builder instead. |
static ValidationResult |
create(Message message,
com.google.common.base.Function<String,? extends ServiceException> exceptionSupplier)
Deprecated.
since 5.7, use {@link com.atlassian.confluence.api.model.validation.SimpleValidationResult.Builder instead.
|
List<ValidationError> |
getErrors()
Deprecated.
|
boolean |
isAuthorized()
Deprecated.
|
boolean |
isValid()
Deprecated.
|
ServiceException |
throwIfInvalid()
Deprecated.
converts this validation result into an Exception and throws it
|
ServiceException |
throwIfInvalid(String msg)
Deprecated.
converts this validation result into an Exception and throws it
|
public static final CoreValidationResult VALID
public static final CoreValidationResult FORBIDDEN
@Deprecated public static CoreValidationResult create(boolean authorized, Collection<ValidationError> coreErrors)
CoreValidationResultFactory#create(boolean, java.util.Collection) instead.ValidationErrors.authorized - boolean value to identify is user is authorized to perform an actioncoreErrors - core errors to adapt into API validation results@Deprecated public static CoreValidationResult create(boolean authorized, List<ValidationError> errors)
SimpleValidationResult.Builder insteadValidationErrors.authorized - boolean value to identify is user is authorized to perform an actionerrors - API errors to transform into API validation results@Deprecated public static CoreValidationResult create(boolean authorized, Message message)
SimpleValidationResult.Builder instead.Message.authorized - boolean value to identify is user is authorized to perform an actionmessage - error message to create an API validation result frompublic static ValidationResult create(Message message, com.google.common.base.Function<String,? extends ServiceException> exceptionSupplier)
Message.message - error message to create an API validation result from, to be used in the exception being thrownexceptionSupplier - provides an exception to be thrown for a specific type of invalid resultpublic boolean isAuthorized()
isAuthorized in interface ValidationResultpublic boolean isValid()
isValid in interface ValidationResultpublic List<ValidationError> getErrors()
getErrors in interface ValidationResultpublic ServiceException throwIfInvalid(String msg) throws ServiceException
ValidationResultthrowIfInvalid in interface ValidationResultServiceExceptionpublic ServiceException throwIfInvalid() throws ServiceException
ValidationResultfirst validation error will be used as message string
throwIfInvalid in interface ValidationResultServiceExceptionpublic ServiceException convertToServiceException(String errorMsg)
Copyright © 2003–2015 Atlassian. All rights reserved.