com.atlassian.confluence.api.model.validation
Class SimpleValidationResult

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

public class SimpleValidationResult
extends Object
implements ValidationResult

Represents the simplest kind of ValidationResult.

Since:
5.6

Nested Class Summary
static class SimpleValidationResult.Builder
           
 
Field Summary
static ValidationResult FORBIDDEN
          A singleton unauthorized result.
static ValidationResult VALID
          A singleton valid result.
 
Method Summary
static SimpleValidationResult.Builder builder()
           
 ServiceException convertToServiceException(String errorMsg)
           
 Collection<ValidationError> getErrors()
           
 boolean isAuthorized()
           
 boolean isValid()
           
 ServiceException throwIfInvalid(String msg)
          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 ValidationResult VALID
A singleton valid result.


FORBIDDEN

public static final ValidationResult FORBIDDEN
A singleton unauthorized result.

Method Detail

isAuthorized

public boolean isAuthorized()
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()
Specified by:
isValid in interface ValidationResult
Returns:
true if there are no errors in this result

getErrors

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

throwIfInvalid

public ServiceException throwIfInvalid(String msg)
                                throws ServiceException
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)

builder

public static SimpleValidationResult.Builder builder()


Copyright © 2003–2015 Atlassian. All rights reserved.