Package org.pac4j.core.profile
Class ProfileHelper
java.lang.Object
org.pac4j.core.profile.ProfileHelper
This class is an helper for profiles.
- Since:
- 1.1.0
- Author:
- Jerome Leleu
-
Method Summary
Modifier and TypeMethodDescriptionstatic UserProfile
buildUserProfileByClassCompleteName
(String completeName) Build a profile by its class name.static <U extends UserProfile>
List<U>flatIntoAProfileList
(Map<String, U> profiles) Flat the map of profiles into a list of profiles.static <U extends UserProfile>
Optional<U>flatIntoOneProfile
(Collection<U> profiles) Flat the list of profiles into a single optional profile (skip any anonymous profile unless it's the only one).static boolean
isTypedIdOf
(String id, Class<? extends UserProfile> clazz) Indicate if the user identifier matches this kind of profile.static String
Sanitize into a string identifier.static void
setProfileClassPrefixes
(List<String> profileClassPrefixes)
-
Method Details
-
isTypedIdOf
Indicate if the user identifier matches this kind of profile.- Parameters:
id
- user identifierclazz
- profile class- Returns:
- if the user identifier matches this kind of profile
-
buildUserProfileByClassCompleteName
Build a profile by its class name.- Parameters:
completeName
- the class name- Returns:
- the built user profile
-
flatIntoOneProfile
Flat the list of profiles into a single optional profile (skip any anonymous profile unless it's the only one).- Type Parameters:
U
- the kind of profile- Parameters:
profiles
- the list of profiles- Returns:
- the (optional) profile
-
flatIntoAProfileList
Flat the map of profiles into a list of profiles.- Type Parameters:
U
- the kind of profile- Parameters:
profiles
- the map of profiles- Returns:
- the list of profiles
-
sanitizeIdentifier
Sanitize into a string identifier.- Parameters:
id
- the identifier object- Returns:
- the sanitized identifier
-
getProfileClassPrefixes
-
setProfileClassPrefixes
-