Interface JWTClaimsSet.Builder<A extends JWTClaimsSet,B extends JWTClaimsSet.Builder<A,B>>

Type Parameters:
A - the JWT Claims set type
B - the JWT Claims set builder type
Enclosing class:
JWTClaimsSet

public static interface JWTClaimsSet.Builder<A extends JWTClaimsSet,B extends JWTClaimsSet.Builder<A,B>>

A JWT Claims set builder is used to build a JWT Claims set.

Since:
1.5
Author:
Jeremy Kuhn
  • Method Details

    • issuer

      B issuer(String iss)

      Specifies the issuer claim as a String.

      Parameters:
      iss - the issuer claim value
      Returns:
      this builder
    • issuer

      B issuer(URI iss)

      Specifies the issuer claim as a URI.

      Parameters:
      iss - the issuer claim value
      Returns:
      this builder
    • subject

      B subject(String sub)

      Specifies the subject claim as a String.

      Parameters:
      sub - the subject claim value
      Returns:
      this builder
    • subject

      B subject(URI sub)

      Specifies the subject claim as a URI.

      Parameters:
      sub - the subject claim value
      Returns:
      this builder
    • audience

      B audience(String aud)

      Specifies the audience claim.

      Parameters:
      aud - the audience claim value
      Returns:
      this builder
    • expirationTime

      B expirationTime(Long exp)

      Specifies the expiration time claim as seconds since epoch.

      Parameters:
      exp - the expiration time claim value
      Returns:
      this builder
    • expirationTime

      B expirationTime(ZonedDateTime exp)

      Specifies the expiration time claim as zoned date time.

      Parameters:
      exp - the expiration time claim value
      Returns:
      this builder
    • notBefore

      B notBefore(Long nbf)

      Specifies the not before claim as seconds since epoch.

      Parameters:
      nbf - the not before claim value
      Returns:
      this builder
    • notBefore

      B notBefore(ZonedDateTime nbf)

      Specifies the not before claim as zoned date time.

      Parameters:
      nbf - the not before claim value
      Returns:
      this builder
    • issuedAt

      B issuedAt(Long iat)

      Specifies the issued at claim as seconds since epoch.

      Parameters:
      iat - the issued at claim value
      Returns:
      this builder
    • issuedAt

      B issuedAt(ZonedDateTime iat)

      Specifies the issued at claim as zoned date time.

      Parameters:
      iat - the issued at claim value
      Returns:
      this builder
    • jwtId

      B jwtId(String jti)

      Specifies the JWT id claim.

      Parameters:
      jti - the JWT id claim value
      Returns:
      this builder
    • addCustomClaim

      B addCustomClaim(String name, Object value)

      Specifies a custom claim.

      Parameters:
      name - the claim name
      value - the claim value
      Returns:
      this builder
    • build

      A build() throws JWTBuildException

      Builds the JWT Claims set.

      Returns:
      a new JWT Claims set
      Throws:
      JWTBuildException - if there was an error building the JWT Claims set