Class PersonFactory
- java.lang.Object
-
- com.atlassian.confluence.api.impl.service.content.factory.ModelFactory<ConfluenceUser,User>
-
- com.atlassian.confluence.api.impl.service.content.factory.PersonFactory
-
public class PersonFactory extends ModelFactory<ConfluenceUser,User>
Builder for Person objects.
-
-
Constructor Summary
Constructors Constructor Description PersonFactory(UserAccessor userAccessor, com.atlassian.plugin.webresource.WebResourceUrlProvider webResourceUrlProvider, I18NBeanFactory i18nBeanFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Anonymous
anonymous()
User
buildFrom(ConfluenceUser hibernateObject, Expansions expansions)
@NonNull Person
forCurrentUser()
@NonNull Person
forCurrentUser(Expansions expansions)
Construct the person object for the current user.Person
forUser(ConfluenceUser user)
Person
forUser(ConfluenceUser user, Expansions expansions)
Construct the person object for a particular user.Person
forUsername(String username)
Construct the person object for a particular username.User
fromUser(@NonNull ConfluenceUser user)
User
fromUser(@NonNull ConfluenceUser user, Expansions expansions)
Constructs a User object for a particular user.-
Methods inherited from class com.atlassian.confluence.api.impl.service.content.factory.ModelFactory
asFunction, buildFrom
-
-
-
-
Constructor Detail
-
PersonFactory
public PersonFactory(UserAccessor userAccessor, com.atlassian.plugin.webresource.WebResourceUrlProvider webResourceUrlProvider, I18NBeanFactory i18nBeanFactory)
-
-
Method Detail
-
forUsername
public Person forUsername(String username)
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
-
forUser
public Person forUser(ConfluenceUser user, Expansions expansions)
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:
forCurrentUser()
-
forUser
public Person forUser(ConfluenceUser user)
-
forCurrentUser
public @NonNull Person forCurrentUser(Expansions expansions)
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:
forUser(com.atlassian.confluence.user.ConfluenceUser)
-
forCurrentUser
public @NonNull Person forCurrentUser()
-
fromUser
public User fromUser(@NonNull ConfluenceUser user, Expansions expansions)
Constructs a User object for a particular user. Null users are not permitted.- Parameters:
user
-- Returns:
-
fromUser
public User fromUser(@NonNull ConfluenceUser user)
-
anonymous
public Anonymous anonymous()
-
buildFrom
public User buildFrom(ConfluenceUser hibernateObject, Expansions expansions)
- Specified by:
buildFrom
in classModelFactory<ConfluenceUser,User>
-
-