public interface ClaimSet
A Set of claims that can be used to verify claims requested by OAuth clients. A ClaimSet is an immutable type, and all methods returning a ClaimSet return new instances.
Since:
4.1.0
  • Method Summary

    Modifier and Type
    Method
    Description
    @io.curity.java_to_ts_docs.annotations.TypescriptDocs("Check whether this ClaimSet is a subset of the given set of claim names;\ni.e. this set is a subset of the given set.") boolean
    areAllIn(Collection<String> claimNames)
    Check whether this ClaimSet is a subset of the given set of claim names; i.e.
    @io.curity.java_to_ts_docs.annotations.TypescriptDocs("Check whether this ClaimSet contains a claim with the given name.") boolean
    contains(String claimName)
    Check whether this ClaimSet contains a claim with the given name.
    @io.curity.java_to_ts_docs.annotations.TypescriptDocs("Check whether this ClaimSet contains all the named claims.") boolean
    Check whether this ClaimSet contains all the named claims.
    filtered(Set<String> claimNames)
    Filters this ClaimSet given a set of claim names; returning only the set of claims named.
    Filters this ClaimSet given a map of scopes; returning the set of claims covered by those scopes.
    get(String claimName)
    Get the claim with the given name.
    Returns a Set of all claims in this ClaimSet.
    Returns the Set of names of all claims in this ClaimSet.
    Returns a new ClaimSet containing only claims where ClaimConfig.isRequired() return true.
    @io.curity.java_to_ts_docs.annotations.TypescriptDocs("Check whether this ClaimSet is empty.") boolean
    Check whether this ClaimSet is empty.
    union(ClaimSet other)
    Returns a new ClaimSet that is the union of the given ClaimSet and this.
  • Method Details

    • get

      Get the claim with the given name.
      Parameters:
      claimName - the claim name
      Returns:
      the claim with the given name; null if this ClaimSet doesn't contain a claim with that name
    • getAll

      Set<ClaimConfig> getAll()
      Returns a Set of all claims in this ClaimSet.
      Returns:
      a Set containing all claims.
    • getAllClaimNames

      Set<String> getAllClaimNames()
      Returns the Set of names of all claims in this ClaimSet.
      Returns:
      a Set containing all claim names
    • getOnlyRequiredClaims

      ClaimSet getOnlyRequiredClaims()
      Returns a new ClaimSet containing only claims where ClaimConfig.isRequired() return true.
      Returns:
      a new ClaimSet containing only required claims
    • isEmpty

      @io.curity.java_to_ts_docs.annotations.TypescriptDocs("Check whether this ClaimSet is empty.") boolean isEmpty()
      Check whether this ClaimSet is empty.
      Returns:
      true if this ClaimSet is empty; false otherwise
    • contains

      @io.curity.java_to_ts_docs.annotations.TypescriptDocs("Check whether this ClaimSet contains a claim with the given name.") boolean contains(String claimName)
      Check whether this ClaimSet contains a claim with the given name.
      Parameters:
      claimName - the claim name
      Returns:
      true if the named claim is in this ClaimSet; false otherwise
    • containsAll

      @io.curity.java_to_ts_docs.annotations.TypescriptDocs("Check whether this ClaimSet contains all the named claims.") boolean containsAll(Collection<String> claimNames)
      Check whether this ClaimSet contains all the named claims.
      Parameters:
      claimNames - the claim names
      Returns:
      true if the all named claims are in this ClaimSet; false otherwise
    • areAllIn

      @io.curity.java_to_ts_docs.annotations.TypescriptDocs("Check whether this ClaimSet is a subset of the given set of claim names;\ni.e. this set is a subset of the given set.") boolean areAllIn(Collection<String> claimNames)
      Check whether this ClaimSet is a subset of the given set of claim names; i.e. this set is a subset of the given set.
      Parameters:
      claimNames - the claim names
      Returns:
      true if this set of claims is a subset of the given set claim names
    • filtered

      ClaimSet filtered(Set<String> claimNames)
      Filters this ClaimSet given a set of claim names; returning only the set of claims named.
      Parameters:
      claimNames - the names of the claims to retain
      Returns:
      a new ClaimSet containing only the named claims
    • filtered

      ClaimSet filtered(ScopeMap scopes)
      Filters this ClaimSet given a map of scopes; returning the set of claims covered by those scopes.
      Parameters:
      scopes - the scopes the claims to retain must belong to
      Returns:
      a new ClaimSet containing the claims covered by the given scopes
    • union

      ClaimSet union(ClaimSet other)
      Returns a new ClaimSet that is the union of the given ClaimSet and this. On overlapping claims, the claims maintained by this ClaimSet are preserved.
      Parameters:
      other - the ClaimSet to merge this with
      Returns:
      a new union ClaimSet