Package com.nimbusds.oauth2.sdk.id
Class Audience
java.lang.Object
com.nimbusds.oauth2.sdk.id.Identifier
com.nimbusds.oauth2.sdk.id.Audience
- All Implemented Interfaces:
Serializable
,Comparable<Identifier>
,net.minidev.json.JSONAware
Audience identifier.
Provides helper methods for:
- Converting to / from string arrays and collections
- Matching audience values
- See Also:
-
Field Summary
Fields inherited from class com.nimbusds.oauth2.sdk.id.Identifier
DEFAULT_BYTE_LENGTH, secureRandom
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCreates an audience list from the specified string array.Creates an audience list from the specified string list representation.boolean
static boolean
matchesAny
(Collection<Audience> c1, Collection<Audience> c2) Returnstrue
if the specified collections have at at least one matching audience value.Returns a singleton list of this audience.toStringList
(Audience audience) Returns a string list representation of the specified audience.toStringList
(List<Audience> audienceList) Returns a string list representation of the specified audience list.Methods inherited from class com.nimbusds.oauth2.sdk.id.Identifier
compareTo, getValue, hashCode, toJSONString, toString, toStringList
-
Constructor Details
-
Audience
Creates a new audience identifier with the specified value.- Parameters:
value
- The audience identifier value. Must not benull
or empty string.
-
Audience
Creates a new audience identifier with the specified URI value.- Parameters:
value
- The URI value. Must not benull
.
-
Audience
Creates a new audience identifier with the specified value.- Parameters:
value
- The value. Must not benull
.
-
-
Method Details
-
toSingleAudienceList
Returns a singleton list of this audience.- Returns:
- A singleton list consisting of this audience only.
-
equals
- Overrides:
equals
in classIdentifier
-
toStringList
Returns a string list representation of the specified audience.- Parameters:
audience
- The audience. May benull
.- Returns:
- The string list,
null
if the argument wasnull
.
-
toStringList
Returns a string list representation of the specified audience list.- Parameters:
audienceList
- The audience list. May benull
.- Returns:
- The string list,
null
if the argument wasnull
.
-
create
Creates an audience list from the specified string list representation.- Parameters:
strings
- The string list. May benull
.- Returns:
- The audience list,
null
if the argument wasnull
.
-
create
Creates an audience list from the specified string array.- Parameters:
strings
- The strings. May benull
.- Returns:
- The audience list,
null
if the argument wasnull
.
-
matchesAny
Returnstrue
if the specified collections have at at least one matching audience value.- Parameters:
c1
- The first audience collection. May benull
.c2
- The second audience collection. May benull
.- Returns:
true
if the specified collections have at at least one matching audience value,false
if there are no matches or either collection isnull
or empty.
-