Class 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 Detail

      • FindUserHelper

        public FindUserHelper()
    • 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 by UserKey
        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