Package org.pac4j.core.profile
Class CommonProfile
- java.lang.Object
-
- org.pac4j.core.profile.BasicUserProfile
-
- org.pac4j.core.profile.CommonProfile
-
- All Implemented Interfaces:
java.io.Externalizable
,java.io.Serializable
,UserProfile
- Direct Known Subclasses:
AbstractJwtProfile
,AnonymousProfile
public class CommonProfile extends BasicUserProfile
This class is the base implementation with the default attribute getters which can be retrieved for most profiles.- Since:
- 1.3.0
- Author:
- Jerome Leleu
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.pac4j.core.profile.BasicUserProfile
logger
-
-
Constructor Summary
Constructors Constructor Description CommonProfile()
CommonProfile(boolean canMergeAttributes)
Create a profile with possibility to merge attributes with the same name and collection-type values
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Date
getAttributeAsDate(java.lang.String name)
java.lang.String
getDisplayName()
Return the displayed name of the user.java.lang.String
getEmail()
Return the email of the user.java.lang.String
getFamilyName()
Return the family name of the user.java.lang.String
getFirstName()
Return the first name of the user.Gender
getGender()
Return the gender of the user.java.util.Locale
getLocale()
Return the locale of the user.java.lang.String
getLocation()
Return the location of the user.java.net.URI
getPictureUrl()
Return the url of the picture of the user.java.net.URI
getProfileUrl()
Return the url of the profile of the user.java.lang.String
getUsername()
Return the username of the user.boolean
isExpired()
-
Methods inherited from class org.pac4j.core.profile.BasicUserProfile
addAttribute, addAttributes, addAuthenticationAttribute, addAuthenticationAttributes, addPermission, addPermissions, addRole, addRoles, asPrincipal, build, build, containsAttribute, containsAuthenicationAttribute, extractAttributeValues, getAttribute, getAttribute, getAttributes, getAuthenticationAttribute, getAuthenticationAttribute, getAuthenticationAttributes, getClientName, getId, getLinkedId, getPermissions, getRoles, getTypedId, isRemembered, readExternal, removeAttribute, removeAuthenticationAttribute, removeLoginData, setClientName, setId, setLinkedId, setPermissions, setRemembered, setRoles, toString, writeExternal
-
-
-
-
Constructor Detail
-
CommonProfile
public CommonProfile()
-
CommonProfile
public CommonProfile(boolean canMergeAttributes)
Create a profile with possibility to merge attributes with the same name and collection-type values- Parameters:
canMergeAttributes
- if true - merge attributes with the same name and collection-type values, if false - overwrite them- Since:
- 3.1.0
-
-
Method Detail
-
getEmail
public java.lang.String getEmail()
Return the email of the user.- Returns:
- the email of the user
-
getFirstName
public java.lang.String getFirstName()
Return the first name of the user.- Returns:
- the first name of the user
-
getFamilyName
public java.lang.String getFamilyName()
Return the family name of the user.- Returns:
- the family name of the user
-
getDisplayName
public java.lang.String getDisplayName()
Return the displayed name of the user. It can be the username or the first and last names (separated by a space).- Returns:
- the displayed name of the user
-
getUsername
public java.lang.String getUsername()
Return the username of the user. It can be a login or a specific username.- Specified by:
getUsername
in interfaceUserProfile
- Overrides:
getUsername
in classBasicUserProfile
- Returns:
- the username of the user
-
getGender
public Gender getGender()
Return the gender of the user.- Returns:
- the gender of the user
-
getLocale
public java.util.Locale getLocale()
Return the locale of the user.- Returns:
- the locale of the user
-
getPictureUrl
public java.net.URI getPictureUrl()
Return the url of the picture of the user.- Returns:
- the url of the picture of the user.
-
getProfileUrl
public java.net.URI getProfileUrl()
Return the url of the profile of the user.- Returns:
- the url of the profile of the user.
-
getLocation
public java.lang.String getLocation()
Return the location of the user.- Returns:
- the location of the user
-
isExpired
public boolean isExpired()
- Specified by:
isExpired
in interfaceUserProfile
- Overrides:
isExpired
in classBasicUserProfile
-
getAttributeAsDate
protected java.util.Date getAttributeAsDate(java.lang.String name)
-
-