public final class Utils extends Object
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static <T extends Comparable<? super T>> |
asSortedList(Collection<T> collection,
Comparator<? super T> comp)
Converts a collection of comparable items into a list, using the given comparator to order the
items.
|
static OAuth2Constants.UrlLocation |
getRequiredUrlLocation(OAuth2Request request,
ClientRegistration clientRegistration)
Determines if the UrlLocation is fragment or query based on the response types read from the request
and the type of client.
|
static OAuth2Constants.UrlLocation |
getRequiredUrlLocation(Set<String> responseTypes,
ClientRegistration clientRegistration)
Determines if the UrlLocation is fragment or query based on the given response types and the type of client.
|
static boolean |
isEmpty(Collection<?> c)
Determines whether the specified Collection is
null or empty. |
static boolean |
isEmpty(Map<?,?> m)
Determines whether the specified Map is
null or empty. |
static boolean |
isEmpty(String s)
Determines whether the specified String is
null or empty. |
static boolean |
isOAuth2FragmentErrorType(Set<String> requestedResponseTypes)
When using the OAuth2 Implicit Grant the response_type value is "token".
|
static boolean |
isOpenIdConnectClient(ClientRegistration clientRegistration)
Check if the OAuth2 Client is configured to be an OpenId Connect Client.
|
static boolean |
isOpenIdConnectFragmentErrorType(Set<String> requestedResponseTypes)
When using the OpenId Connect authorization Implicit Flow the response_type value is
"id_token token" or "id_token".
|
static String |
joinScope(Set<String> scope)
Joins the specified
Set of scopes into a space delimited String. |
static Set<String> |
splitResponseType(String responseType)
Splits the specified String of response types into a
Set of response types. |
static Set<String> |
splitScope(String scope)
Splits the specified String of scopes into a
Set of scopes. |
static Set<String> |
stringToSet(String string)
Splits the string on ' ' character and returns a
Set<String> of the contents. |
public static boolean isEmpty(String s)
null
or empty.s
- The String to check.true
if the String is null
or empty.public static boolean isEmpty(Collection<?> c)
null
or empty.c
- The Collection to check.true
if the Collection is null
or empty.public static boolean isEmpty(Map<?,?> m)
null
or empty.m
- The Map to check.true
if the Map is null
or empty.public static Set<String> splitResponseType(String responseType)
Set
of response types.
null
an empty Set
is returned.responseType
- The String of response types.Set
of response types.public static Set<String> splitScope(String scope)
Set
of scopes.
null
an empty Set
is returned.scope
- The String of scopes.Set
of scopes.public static String joinScope(Set<String> scope)
Set
of scopes into a space delimited String.
Set
of scopes is null, an empty String is returned.scope
- The scopes to join.public static Set<String> stringToSet(String string)
Set<String>
of the contents.string
- The string.Set<String>
.public static boolean isOpenIdConnectFragmentErrorType(Set<String> requestedResponseTypes)
public static boolean isOAuth2FragmentErrorType(Set<String> requestedResponseTypes)
public static boolean isOpenIdConnectClient(ClientRegistration clientRegistration)
clientRegistration
- The registered client.public static OAuth2Constants.UrlLocation getRequiredUrlLocation(OAuth2Request request, ClientRegistration clientRegistration)
request
- The OAuth2 request.clientRegistration
- The ClientRegistration.public static OAuth2Constants.UrlLocation getRequiredUrlLocation(Set<String> responseTypes, ClientRegistration clientRegistration)
responseTypes
- The requested response types.clientRegistration
- The registered client.public static <T extends Comparable<? super T>> List<T> asSortedList(Collection<T> collection, Comparator<? super T> comp)
T
- The type of the collection.collection
- The collection to sortcomp
- The comparator to useCopyright © 2010–2025 Open Identity Platform Community. All rights reserved.