/** * Add a specific JWT Id ("jti") claim to the Payload. * * @param jwtId the Token Id value. * @return this same Builder instance. */ public Builder withJWTId(String jwtId) { addClaim(PublicClaims.JWT_ID, jwtId); return this; }
/** * Add a custom Claim value. * * @param name the Claim's name. * @param value the Claim's value. * @return this same Builder instance. * @throws IllegalArgumentException if the name is null. */ public Builder withClaim(String name, Integer value) throws IllegalArgumentException { assertNonNull(name); addClaim(name, value); return this; }
/** * Add a custom Array Claim with the given items. * * @param name the Claim's name. * @param items the Claim's value. * @return this same Builder instance. * @throws IllegalArgumentException if the name is null. */ public Builder withArrayClaim(String name, String[] items) throws IllegalArgumentException { assertNonNull(name); addClaim(name, items); return this; }
/** * Add a custom Claim value. * * @param name the Claim's name. * @param value the Claim's value. * @return this same Builder instance. * @throws IllegalArgumentException if the name is null. */ public Builder withClaim(String name, Double value) throws IllegalArgumentException { assertNonNull(name); addClaim(name, value); return this; }
/** * Add a custom Array Claim with the given items. * * @param name the Claim's name. * @param items the Claim's value. * @return this same Builder instance. * @throws IllegalArgumentException if the name is null. */ public Builder withArrayClaim(String name, String[] items) throws IllegalArgumentException { assertNonNull(name); addClaim(name, items); return this; }
/** * Add a custom Claim value. * * @param name the Claim's name. * @param value the Claim's value. * @return this same Builder instance. * @throws IllegalArgumentException if the name is null. */ public Builder withClaim(String name, Double value) throws IllegalArgumentException { assertNonNull(name); addClaim(name, value); return this; }
/** * Add a custom Claim value. * * @param name the Claim's name. * @param value the Claim's value. * @return this same Builder instance. * @throws IllegalArgumentException if the name is null. */ public Builder withClaim(String name, Long value) throws IllegalArgumentException { assertNonNull(name); addClaim(name, value); return this; }
/** * Add a custom Array Claim with the given items. * * @param name the Claim's name. * @param items the Claim's value. * @return this same Builder instance. * @throws IllegalArgumentException if the name is null. */ public Builder withArrayClaim(String name, Integer[] items) throws IllegalArgumentException { assertNonNull(name); addClaim(name, items); return this; }
/** * Add a custom Claim value. * * @param name the Claim's name. * @param value the Claim's value. * @return this same Builder instance. * @throws IllegalArgumentException if the name is null. */ public Builder withClaim(String name, Date value) throws IllegalArgumentException { assertNonNull(name); addClaim(name, value); return this; }
/** * Add a custom Claim value. * * @param name the Claim's name. * @param value the Claim's value. * @return this same Builder instance. * @throws IllegalArgumentException if the name is null. */ public Builder withClaim(String name, String value) throws IllegalArgumentException { assertNonNull(name); addClaim(name, value); return this; }
/** * Add a custom Claim value. * * @param name the Claim's name. * @param value the Claim's value. * @return this same Builder instance. * @throws IllegalArgumentException if the name is null. */ public Builder withClaim(String name, Boolean value) throws IllegalArgumentException { assertNonNull(name); addClaim(name, value); return this; }
/** * Add a specific JWT Id ("jti") claim to the Payload. * * @param jwtId the Token Id value. * @return this same Builder instance. */ public Builder withJWTId(String jwtId) { addClaim(PublicClaims.JWT_ID, jwtId); return this; }
/** * Add a specific Audience ("aud") claim to the Payload. * * @param audience the Audience value. * @return this same Builder instance. */ public Builder withAudience(String... audience) { addClaim(PublicClaims.AUDIENCE, audience); return this; }
/** * Add a specific Subject ("sub") claim to the Payload. * * @param subject the Subject value. * @return this same Builder instance. */ public Builder withSubject(String subject) { addClaim(PublicClaims.SUBJECT, subject); return this; }
/** * Add a specific Not Before ("nbf") claim to the Payload. * * @param notBefore the Not Before value. * @return this same Builder instance. */ public Builder withNotBefore(Date notBefore) { addClaim(PublicClaims.NOT_BEFORE, notBefore); return this; }
/** * Add a specific Issued At ("iat") claim to the Payload. * * @param issuedAt the Issued At value. * @return this same Builder instance. */ public Builder withIssuedAt(Date issuedAt) { addClaim(PublicClaims.ISSUED_AT, issuedAt); return this; }
/** * Add a specific Expires At ("exp") claim to the Payload. * * @param expiresAt the Expires At value. * @return this same Builder instance. */ public Builder withExpiresAt(Date expiresAt) { addClaim(PublicClaims.EXPIRES_AT, expiresAt); return this; }
/** * Add a custom Array Claim with the given items. * * @param name the Claim's name. * @param items the Claim's value. * @return this same Builder instance. * @throws IllegalArgumentException if the name is null. */ public Builder withArrayClaim(String name, Long[] items) throws IllegalArgumentException { assertNonNull(name); addClaim(name, items); return this; }
/** * Add a custom Claim value. * * @param name the Claim's name. * @param value the Claim's value. * @return this same Builder instance. * @throws IllegalArgumentException if the name is null. */ public Builder withClaim(String name, Integer value) throws IllegalArgumentException { assertNonNull(name); addClaim(name, value); return this; }
/** * Add a specific Issuer ("iss") claim to the Payload. * * @param issuer the Issuer value. * @return this same Builder instance. */ public Builder withIssuer(String issuer) { addClaim(PublicClaims.ISSUER, issuer); return this; }