Interface ClaimSet
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 TypeMethodDescription@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.") booleanareAllIn(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.") booleanCheck 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.") booleancontainsAll(Collection<String> claimNames) Check whether this ClaimSet contains all the named claims.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 the claim with the given name.getAll()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 whereClaimConfig.isRequired()returntrue.@io.curity.java_to_ts_docs.annotations.TypescriptDocs("Check whether this ClaimSet is empty.") booleanisEmpty()Check whether this ClaimSet is empty.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;
nullif 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
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 whereClaimConfig.isRequired()returntrue.- 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:
trueif this ClaimSet is empty;falseotherwise
-
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:
trueif the named claim is in this ClaimSet;falseotherwise
-
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:
trueif the all named claims are in this ClaimSet;falseotherwise
-
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:
trueif this set of claims is a subset of the given set claim names
-
filtered
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
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
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
-