/** * <p> * Provides programmatic access to (some) specific reasons for JWT invalidity * by indicating if the given error code was one of the reasons for the * JWT being considered invalid. * </p> * <p> * Error codes used by this library are defined in {@link ErrorCodes}. * </p> * @param code the given error code * @return true if the given error code was one of the reasons for the JWT being invalid and false otherwise */ public boolean hasErrorCode(int code) { for (ErrorCodeValidator.Error error : details) { if (code == error.getErrorCode()) { return true; } } return false; }