Class Result


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

      • 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.