Class FindUserHelper
- java.lang.Object
-
- com.atlassian.confluence.user.persistence.dao.compatibility.FindUserHelper
-
public class FindUserHelper extends Object
A utility class that centralises the 'hackyness' involved during the period we support both username related APIs and the change to user keys.Find all usages of this class and you will find all the places that 'transitional hackyness' is taking place.
-
-
Constructor Summary
Constructors Constructor Description FindUserHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ConfluenceUser
getUser(@Nullable com.atlassian.user.User user)
static ConfluenceUser
getUserByUserKey(com.atlassian.sal.api.user.UserKey userKey)
Get a user byUserKey
static @Nullable ConfluenceUser
getUserByUsername(@Nullable String username)
Get a user by username.
-
-
-
Method Detail
-
getUserByUsername
public static @Nullable ConfluenceUser getUserByUsername(@Nullable String username)
Get a user by username.- Parameters:
username
- the username of the user required- Returns:
- user with the given username or null if the username is null or empty or no user is found.
-
getUserByUserKey
public static ConfluenceUser getUserByUserKey(com.atlassian.sal.api.user.UserKey userKey)
Get a user byUserKey
- Parameters:
userKey
-- Returns:
- the identified user
- Throws:
IllegalArgumentException
- if no user can be found for the key
-
getUser
public static ConfluenceUser getUser(@Nullable com.atlassian.user.User user)
- Returns:
- ConfluenceUser for the given user
-
-