java.lang.Object
org.forgerock.openig.tools.jwt.validation.Result

public final class Result extends Object
A Result of a JWT validation.
  • Method Details

    • success

      public static Result success()
      Returns a Result representing validation success.
      Returns:
      a Result containing no Violation.
    • failure

      public static Result failure(Violation violation)
      Returns a Result representing validation failure.
      Parameters:
      violation - The Violation responsible of this failure, not null.
      Returns:
      a Result containing the Violation.
    • isSuccess

      public boolean isSuccess()
      Returns true if this Result is a success, false otherwise.
      Returns:
      true if this Result is a success, false otherwise.
    • isFailure

      public boolean isFailure()
      Returns true 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 completed Promise.
      Returns:
      this result as a completed Promise.