Class Result
java.lang.Object
org.forgerock.openig.tools.jwt.validation.Result
A
Result
of a JWT validation.-
Method Summary
Modifier and TypeMethodDescriptionReturn this result as a completedPromise
.static Result
Returns aResult
representing validation failure.Return the Violation if it is present,null
otherwise.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 Result containing no
Violation
.
-
failure
Returns aResult
representing validation failure.- Parameters:
violation
- The Violation responsible of this failure, notnull
.- Returns:
- a Result containing the Violation.
-
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.
-
getViolation
Return the Violation if it is present,null
otherwise.- Returns:
- the Violation if it is present,
null
otherwise.
-
asPromise
Return this result as a completedPromise
.- Returns:
- this result as a completed
Promise
.
-