All Known Subinterfaces:
JwtClaims, OpenIdClaims

public interface Claims
  • Method Details

    • getStringClaim

      Optional<String> getStringClaim(String name)
      Get String claim of given name
      Parameters:
      name -
      Returns:
      value, or empty optional if not present
      Throws:
      IllegalArgumentException - when value of claim is not a string
    • getNumericDateClaim

      Optional<Instant> getNumericDateClaim(String name)
      Get Numeric Date claim of given name
      Parameters:
      name -
      Returns:
      value, or empty optional if not present
      Throws:
      IllegalArgumentException - when value of claim is not a number that represents an epoch seconds
    • getArrayStringClaim

      List<String> getArrayStringClaim(String name)
      Get String List claim of given name
      Parameters:
      name -
      Returns:
      a list with values of the claim, or empty list if value is not present.
      Throws:
      IllegalArgumentException - when value of claim is neither string or array of strings
    • getIntClaim

      OptionalInt getIntClaim(String name)
      Get integer claim of given name
      Parameters:
      name -
      Returns:
      value, or empty optional if not present
      Throws:
      IllegalArgumentException - when value of claim is not a number
    • getLongClaim

      OptionalLong getLongClaim(String name)
      Get long claim of given name
      Parameters:
      name -
      Returns:
      value, or empty optional if not present
      Throws:
      IllegalArgumentException - when value of claim is not a number
    • getDoubleClaim

      OptionalDouble getDoubleClaim(String name)
      Get double claim of given name
      Parameters:
      name -
      Returns:
      value, or empty optional if not present
      Throws:
      IllegalArgumentException - when value of claim is not a number
    • getNested

      Optional<Claims> getNested(String name)
      Get nested claims of given name.
      Parameters:
      name -
      Returns:
      Claims instance represented nested values within that claim, or empty optional if not present
      Throws:
      IllegalArgumentException - when value is not a nested object