Class Result
- java.lang.Object
-
- org.forgerock.openig.tools.jwt.validation.Result
-
public final class Result extends Object
AResult
of a JWT validation.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Promise<Result,NeverThrowsException>
asPromise()
Return this result as a completedPromise
.static Result
failure(Violation violation)
Returns aResult
representing validation failure.Violation
getViolation()
Return the Violation if it is present,null
otherwise.boolean
isFailure()
Returnstrue
if this Result is a failure,false
otherwise.boolean
isSuccess()
Returnstrue
if this Result is a success,false
otherwise.static Result
success()
Returns aResult
representing validation success.
-
-
-
Method Detail
-
success
public static Result success()
Returns aResult
representing validation success.- Returns:
- a Result containing no
Violation
.
-
failure
public static Result failure(Violation violation)
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
public Violation getViolation()
Return the Violation if it is present,null
otherwise.- Returns:
- the Violation if it is present,
null
otherwise.
-
asPromise
public Promise<Result,NeverThrowsException> asPromise()
Return this result as a completedPromise
.- Returns:
- this result as a completed
Promise
.
-
-