Class UserEntityUtil
java.lang.Object
com.atlassian.crowd.plugin.rest.util.UserEntityUtil
Utility class for UserEntity.
-
Method Summary
Modifier and TypeMethodDescriptionstatic UserEntity
expandUser
(ApplicationService applicationService, Application application, UserEntity minimalUserEntity, boolean expandAttributes) Expands a UserEntity from its minimal form to the expanded version.static UserEntity
expandUser
(DirectoryManager directoryManager, long directoryId, UserEntity minimalUserEntity, boolean expandAttributes) static UserEntity
static UserEntity
translateWithAttributes
(User user, Attributes attributes, com.atlassian.plugins.rest.api.model.Link oldLink)
-
Method Details
-
expandUser
public static UserEntity expandUser(ApplicationService applicationService, Application application, UserEntity minimalUserEntity, boolean expandAttributes) throws UserNotFoundException Expands a UserEntity from its minimal form to the expanded version. Attributes are expanded ifexpandAttributes</tt> is <tt>true
, otherwise, UserEntity is returned with no attributes expanded.N.B. This is not the same as expanding a user entity, which expands a UserEntity from its minimal form, to having all the first name, last name, email, etc filled in. Expanding a UserEntity is automatically performed in
UserEntityExpander
.- Parameters:
applicationService
- ApplicationService to find a userapplication
- name of the application requesting the userminimalUserEntity
- Minimal representation of a UserEntity. Must include at least a username and a link.expandAttributes
- set to true if the expanded UserEntity should expand attributes.- Returns:
- UserEntity expanded UserEntity
- Throws:
IllegalArgumentException
- if the minimal UserEntity does not include at least a username and a link.UserNotFoundException
- if a user with the specified username could not be found.
-
translate
-
translateWithAttributes
public static UserEntity translateWithAttributes(User user, Attributes attributes, com.atlassian.plugins.rest.api.model.Link oldLink) -
expandUser
public static UserEntity expandUser(DirectoryManager directoryManager, long directoryId, UserEntity minimalUserEntity, boolean expandAttributes) throws UserNotFoundException, DirectoryNotFoundException, OperationFailedException
-