com.atlassian.confluence.api.impl.model.validation
Class CoreValidationResult

java.lang.Object
  extended by com.atlassian.confluence.api.impl.model.validation.CoreValidationResult
All Implemented Interfaces:
ValidationResult

Deprecated. since 5.7, use SimpleValidationResult instead.

@Deprecated
public class CoreValidationResult
extends Object
implements ValidationResult

Adapts Confluence Core ValidationErrors to API ValidationResults.


Field Summary
static CoreValidationResult FORBIDDEN
          Deprecated. A singleton unauthorized result.
static CoreValidationResult VALID
          Deprecated. A singleton valid result.
 
Method Summary
 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(String msg)
          Deprecated. converts this validation result into an Exception and throws it
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VALID

public static final CoreValidationResult VALID
Deprecated. 
A singleton valid result.


FORBIDDEN

public static final CoreValidationResult FORBIDDEN
Deprecated. 
A singleton unauthorized result.

Method Detail

create

@Deprecated
public static CoreValidationResult create(boolean authorized,
                                                     Collection<ValidationError> coreErrors)
Deprecated. since 5.7, use CoreValidationResultFactory#create(boolean, java.util.Collection) instead.

Creates an API validation result from ValidationErrors.

Parameters:
authorized - boolean value to identify is user is authorized to perform an action
coreErrors - core errors to adapt into API validation results
Returns:
a core validation result

create

@Deprecated
public static CoreValidationResult create(boolean authorized,
                                                     List<ValidationError> errors)
Deprecated. since 5.7, use SimpleValidationResult.Builder instead

Creates an API validation result from ValidationErrors.

Parameters:
authorized - boolean value to identify is user is authorized to perform an action
errors - API errors to transform into API validation results
Returns:
a core validation result

create

@Deprecated
public static CoreValidationResult create(boolean authorized,
                                                     Message message)
Deprecated. since 5.7, use SimpleValidationResult.Builder instead.

Creates an API validation result from a Message.

Parameters:
authorized - boolean value to identify is user is authorized to perform an action
message - error message to create an API validation result from
Returns:
a core validation result

create

public 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.

Creates an API validation result from a Message.

Parameters:
message - error message to create an API validation result from, to be used in the exception being thrown
exceptionSupplier - provides an exception to be thrown for a specific type of invalid result
Returns:
a core validation result

isAuthorized

public boolean isAuthorized()
Deprecated. 
Specified by:
isAuthorized in interface ValidationResult
Returns:
true if the current user is permitted to perform the execution that the validation is for

isValid

public boolean isValid()
Deprecated. 
Specified by:
isValid in interface ValidationResult
Returns:
true if there are no errors in this result

getErrors

public List<ValidationError> getErrors()
Deprecated. 
Specified by:
getErrors in interface ValidationResult
Returns:
an iterable of the errors stored in this result

throwIfInvalid

public ServiceException throwIfInvalid(String msg)
                                throws ServiceException
Deprecated. 
Description copied from interface: ValidationResult
converts this validation result into an Exception and throws it

Specified by:
throwIfInvalid in interface ValidationResult
Returns:
the exception that will be thrown
Throws:
ServiceException

convertToServiceException

public ServiceException convertToServiceException(String errorMsg)
Deprecated. 


Copyright © 2003–2015 Atlassian. All rights reserved.