Class Result
java.lang.Object
org.forgerock.openig.filter.oauth2.cnf.Result
A
Result represents the result of a validation operation:
either a success or a failure (with an associated description).-
Method Summary
Modifier and TypeMethodDescriptionReturns a new completed promise wrapping this result.static ResultReturns aResultrepresenting validation failure.Returns the failure description (nullif this is a success).booleanReturnstrueif this Result is a failure,falseotherwise.booleanReturnstrueif this Result is a success,falseotherwise.static Resultsuccess()Returns aResultrepresenting validation success.
-
Method Details
-
success
Returns aResultrepresenting validation success.- Returns:
- a successful result.
-
failure
Returns aResultrepresenting validation failure.- Parameters:
description- The description of this failure, notnull.- Returns:
- a failed result.
-
isSuccess
public boolean isSuccess()Returnstrueif this Result is a success,falseotherwise.- Returns:
trueif this Result is a success,falseotherwise
-
isFailure
public boolean isFailure()Returnstrueif this Result is a failure,falseotherwise.- Returns:
trueif this Result is a failure,falseotherwise
-
getDescription
Returns the failure description (nullif this is a success).- Returns:
- the failure description (
nullif this is a success)
-
asPromise
Returns a new completed promise wrapping this result.- Returns:
- a new completed promise wrapping this result
-