Class UserManager

java.lang.Object
net.dzikoysk.funnyguilds.user.UserManager

public class UserManager extends Object
  • Constructor Details

  • Method Details

    • countUsers

      public int countUsers()
    • getUsers

      public Set<User> getUsers()
      Gets the copied set of users.
      Returns:
      set of users
    • clearUsers

      public void clearUsers()
      Deletes all loaded users data
    • findByNames

      public Set<User> findByNames(Collection<String> names)
      Gets the set of users from collection of strings (names).
      Parameters:
      names - collection of names
      Returns:
      set of users
    • findByUuid

      public panda.std.Option<User> findByUuid(UUID uuid)
      Gets the user.
      Parameters:
      uuid - the universally unique identifier of user
      Returns:
      the user
    • findByName

      public panda.std.Option<User> findByName(String nickname)
      Gets the user.
      Parameters:
      nickname - the name of user
      Returns:
      the user
    • findByName

      public panda.std.Option<User> findByName(String nickname, boolean ignoreCase)
      Gets the user.
      Parameters:
      nickname - the name of user
      ignoreCase - ignore the case of the nickname
      Returns:
      the user
    • findByPlayer

      public panda.std.Option<User> findByPlayer(@NotNull @NotNull org.bukkit.entity.Player player)
      Gets the user.
      Returns:
      the user
    • findByPlayer

      public panda.std.Option<User> findByPlayer(org.bukkit.OfflinePlayer offlinePlayer)
      Gets the user.
      Returns:
      the user
    • createFake

      public User createFake(UUID uuid, String name)
    • createFake

      public User createFake(UUID uuid, String name, FakeUserProfile profile)
    • create

      public User create(UUID uuid, String name, UserProfile userProfile)
      Create the user and add it to storage. If you think you should use this method you probably shouldn't - instead use findByUuid(UUID), findByName(String) etc.
      Parameters:
      uuid - the universally unique identifier which will be assigned to user
      name - the nickname which will be assigned to User
      userProfile - the user profile which will be assigned to User
      Returns:
      the user
    • addUser

      public void addUser(User user)
      Add user to storage. If you think you should use this method you probably shouldn't.
      Parameters:
      user - user to add
    • removeUser

      public void removeUser(User user)
      Remove user from storage. If you think you should use this method you probably shouldn't.
      Parameters:
      user - user to remove
    • updateUsername

      public void updateUsername(User user, String newUsername)
      Update username for user.
      Parameters:
      user - the user for which the nickname will be changed
      newUsername - the new nickname for user
    • playedBefore

      public boolean playedBefore(String nickname)
      Checks if user with given nickname have ever played on a server.
      Parameters:
      nickname - the nickname of user to check if ever played on
      Returns:
      if user with given name have ever played on a server
    • playedBefore

      public boolean playedBefore(String nickname, boolean ignoreCase)
      Checks if user with given nickname have ever played on a server.
      Parameters:
      nickname - the nickname of user to check if ever played on
      ignoreCase - ignore the case of the nickname
      Returns:
      if user with given name have ever played on a server
    • getInstance

      @Deprecated @ScheduledForRemoval(inVersion="5.0") public static UserManager getInstance()
      Deprecated.
      for removal in the future, in favour of FunnyGuilds.getUserManager()
      Gets the user manager.
      Returns:
      the user manager