SimpleValidationResult
instead.@Deprecated public class CoreValidationResult extends Object implements ValidationResult
ValidationError
s to API ValidationResult
s.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.
Converts this validation result into a
ServiceException without throwing. |
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.
Returns an iterable of the errors (if any) stored in this result.
|
boolean |
isAuthorized()
Deprecated.
Checks for authorization status.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isNotSuccessful, isSuccessful, isValid, throwIfInvalid, throwIfInvalid, throwIfNotSuccessful, throwIfNotSuccessful, throwIfNotValid
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.ValidationError
s.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
insteadValidationError
s.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 from@Deprecated public 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()
ValidationResult
validity check
.isAuthorized
in interface ValidationResult
true
if the current user is permitted to perform the execution that the validation is for, false
otherwise.ValidationResult.isValid()
,
ValidationResult.isSuccessful()
public List<ValidationError> getErrors()
ValidationResult
ValidationResult.isValid()
returning false
.
Default implementation of ValidationResult.isValid()
is safe for null
values.
Be cautious about returning null
if not using the default implementation for ValidationResult.isValid()
.
getErrors
in interface ValidationResult
ValidationResult.isValid()
,
ValidationError
public ServiceException convertToServiceException(String errorMsg)
ValidationResult
ServiceException
without throwing.
Implementations of this method should reasonably analyze the internals of this ValidationResult
and return appropriate subclass of ServiceException
which is most suitable for the case.
This method is used internally in the default implementations of ValidationResult.throwIfNotSuccessful()
and ValidationResult.throwIfNotSuccessful(String)
convertToServiceException
in interface ValidationResult
errorMsg
- message to put in the Exception returnedServiceException
subclass.ValidationResult.throwIfNotSuccessful()
,
ValidationResult.throwIfNotSuccessful(String)
Copyright © 2003–2018 Atlassian. All rights reserved.