Class RestValidationResult
- java.lang.Object
-
- com.atlassian.confluence.rest.api.model.validation.RestValidationResult
-
- All Implemented Interfaces:
ValidationResult
@ExperimentalApi public class RestValidationResult extends Object implements ValidationResult
REST-friendly version of aValidationResult.- Since:
- 5.6
-
-
Constructor Summary
Constructors Constructor Description RestValidationResult(ValidationResult that)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Iterable<ValidationError>getErrors()Returns an iterable of the errors (if any) stored in this result.booleanisAllowedInReadOnlyMode()Checks for allowedInReadOnlyMode status.booleanisAuthorized()Checks for authorization status.booleanisValid()Checks for validity.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.atlassian.confluence.api.model.validation.ValidationResult
convertToServiceException, isNotSuccessful, isSuccessful, throwIfInvalid, throwIfInvalid, throwIfNotSuccessful, throwIfNotSuccessful, throwIfNotValid
-
-
-
-
Constructor Detail
-
RestValidationResult
public RestValidationResult(ValidationResult that)
-
-
Method Detail
-
isAuthorized
public boolean isAuthorized()
Description copied from interface:ValidationResultChecks for authorization status. Does NOT imply thevalidity check.- Specified by:
isAuthorizedin interfaceValidationResult- Returns:
trueif the current user is permitted to perform the execution that the validation is for,falseotherwise.- See Also:
ValidationResult.isValid(),ValidationResult.isSuccessful()
-
isAllowedInReadOnlyMode
public boolean isAllowedInReadOnlyMode()
Description copied from interface:ValidationResultChecks for allowedInReadOnlyMode status. Does NOT imply thevalidity check.- Specified by:
isAllowedInReadOnlyModein interfaceValidationResult- Returns:
trueif the current user is allowed to perform the execution in read-only mode that the validation is for,falseotherwise.- See Also:
ValidationResult.isValid(),ValidationResult.isSuccessful()
-
isValid
public boolean isValid()
Description copied from interface:ValidationResultChecks for validity. Does NOT imply theauthorization check.By contract implementations MUST return
falseif there are errors in this ValidationResult. Default implementation is usually enough.- Specified by:
isValidin interfaceValidationResult- Returns:
trueif there are no errors in this result,falseotherwise.- See Also:
ValidationResult.getErrors(),ValidationResult.isAuthorized(),ValidationResult.isSuccessful()
-
getErrors
public Iterable<ValidationError> getErrors()
Description copied from interface:ValidationResultReturns an iterable of the errors (if any) stored in this result. By contract having any errors here MUST also result inValidationResult.isValid()returningfalse.Default implementation of
ValidationResult.isValid()is safe fornullvalues. Be cautious about returningnullif not using the default implementation forValidationResult.isValid().- Specified by:
getErrorsin interfaceValidationResult- Returns:
- an iterable of the errors stored in this result.
- See Also:
ValidationResult.isValid(),ValidationError
-
-