Class PersonFactory
java.lang.Object
com.atlassian.confluence.api.impl.service.content.factory.PersonFactory
- All Implemented Interfaces:
ModelFactory<ConfluenceUser,
User>
Builder for Person objects.
-
Constructor Summary
ConstructorsConstructorDescriptionPersonFactory
(UserAccessor userAccessor, com.atlassian.webresource.api.WebResourceUrlProvider webResourceUrlProvider, I18NBeanFactory i18nBeanFactory, LoginManager loginManager, DateFormatterFactory dateFormatterFactory) -
Method Summary
Modifier and TypeMethodDescriptionbuildFrom
(ConfluenceUser hibernateObject, Expansions expansions) @NonNull Person
@NonNull Person
forCurrentUser
(Expansions expansions) Construct the person object for the current user.forUser
(ConfluenceUser user) forUser
(ConfluenceUser user, Expansions expansions) Construct the person object for a particular user.forUser
(ConfluenceUser user, Expansions expansions, boolean profilePictureIncludedByDefault) Construct the person object for a particular user.forUserKey
(String userKey, Expansions expansions) Construct the person object for a particular userKey.forUserKeyWithoutProfile
(String userKey) Find a person by user keyforUserKeyWithoutProfile
(String userKey, Expansions expansions) Find a person by user keyforUsername
(String username) Construct the person object for a particular username.forUsernameWithoutProfile
(String username) Construct the person object for a particular username.forUserWithLoginInfo
(ConfluenceUser user, Expansions expansions) fromUser
(@NonNull ConfluenceUser user) fromUser
(@NonNull ConfluenceUser user, Expansions expansions) Constructs a User object for a particular user.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.confluence.api.model.ModelFactory
buildFrom
-
Constructor Details
-
PersonFactory
public PersonFactory(UserAccessor userAccessor, com.atlassian.webresource.api.WebResourceUrlProvider webResourceUrlProvider, I18NBeanFactory i18nBeanFactory, LoginManager loginManager, DateFormatterFactory dateFormatterFactory)
-
-
Method Details
-
forUsername
Construct the person object for a particular username. Null usernames will return the anonymous person- Parameters:
username
- the username of the person to represent- Returns:
- the corresponding Person object
-
forUsernameWithoutProfile
Construct the person object for a particular username. Null usernames will return the anonymous person This will not load profile picture to keep better performance- Parameters:
username
-- Returns:
-
forUserKeyWithoutProfile
Find a person by user key- Parameters:
userKey
- the user key string- Returns:
- a
Person
object - Since:
- 9.3.0
-
forUserKeyWithoutProfile
Find a person by user key- Parameters:
userKey
- the user key string- Returns:
- a
Person
object - Since:
- 9.3.0
-
forUserKey
Construct the person object for a particular userKey. Null usernames will return the anonymous person- Parameters:
userKey
- the user key of the person to represent- Returns:
- the corresponding Person object
-
forUser
Construct the person object for a particular user. Null users will return the anonymous person- Parameters:
user
- the user to represent as a Person- Returns:
- the corresponding Person object
- See Also:
-
forUser
public Person forUser(ConfluenceUser user, Expansions expansions, boolean profilePictureIncludedByDefault) Construct the person object for a particular user. Null users will return the anonymous person.- Parameters:
user
- the user to represent as a PersonprofilePictureIncludedByDefault
- whether the profile picture of a user should be included by default (if not, it is possible to provide an expansion to include it).- Returns:
- the corresponding Person object
-
forUserWithLoginInfo
-
forUser
-
forCurrentUser
Construct the person object for the current user. Null users will return the anonymous person- Returns:
- the corresponding Person object for the thread-local authenticated user
- See Also:
-
forCurrentUser
-
fromUser
Constructs a User object for a particular user. Null users are not permitted.- Parameters:
user
-- Returns:
-
fromUser
-
anonymous
-
buildFrom
- Specified by:
buildFrom
in interfaceModelFactory<ConfluenceUser,
User>
-