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 Result
Returns aResult
representing validation failure.Returns the failure description (null
if this is a success).boolean
Returnstrue
if this Result is a failure,false
otherwise.boolean
Returnstrue
if this Result is a success,false
otherwise.static Result
success()
Returns aResult
representing validation success.
-
Method Details
-
success
Returns aResult
representing validation success.- Returns:
- a successful result.
-
failure
Returns aResult
representing validation failure.- Parameters:
description
- The description of this failure, notnull
.- Returns:
- a failed result.
-
isSuccess
public boolean isSuccess()Returnstrue
if this Result is a success,false
otherwise.- Returns:
true
if this Result is a success,false
otherwise.
-
isFailure
public boolean isFailure()Returnstrue
if this Result is a failure,false
otherwise.- Returns:
true
if this Result is a failure,false
otherwise.
-
getDescription
Returns the failure description (null
if this is a success).- Returns:
- the failure description (
null
if this is a success).
-
asPromise
Returns a new completed promise wrapping this result.- Returns:
- a new completed promise wrapping this result.
-