Package net.dzikoysk.funnyguilds.user
Class UserManager
java.lang.Object
net.dzikoysk.funnyguilds.user.UserManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd user to storage.voidDeletes all loaded users dataintcreate(UUID uuid, String name, UserProfile userProfile) Create the user and add it to storage.createFake(UUID uuid, String name) createFake(UUID uuid, String name, FakeUserProfile profile) panda.std.Option<User>findByName(String nickname) Gets the user.panda.std.Option<User>findByName(String nickname, boolean ignoreCase) Gets the user.findByNames(Collection<String> names) Gets the set of users from collection of strings (names).panda.std.Option<User>findByPlayer(@NotNull org.bukkit.entity.Player player) Gets the user.panda.std.Option<User>findByPlayer(org.bukkit.OfflinePlayer offlinePlayer) Gets the user.panda.std.Option<User>findByUuid(UUID uuid) Gets the user.static UserManagerDeprecated.getUsers()Gets the copied set of users.booleanplayedBefore(String nickname) Checks if user with given nickname have ever played on a server.booleanplayedBefore(String nickname, boolean ignoreCase) Checks if user with given nickname have ever played on a server.voidremoveUser(User user) Remove user from storage.voidupdateUsername(User user, String newUsername) Update username for user.
-
Constructor Details
-
UserManager
-
-
Method Details
-
countUsers
public int countUsers() -
getUsers
Gets the copied set of users.- Returns:
- set of users
-
clearUsers
public void clearUsers()Deletes all loaded users data -
findByNames
Gets the set of users from collection of strings (names).- Parameters:
names- collection of names- Returns:
- set of users
-
findByUuid
Gets the user.- Parameters:
uuid- the universally unique identifier of user- Returns:
- the user
-
findByName
Gets the user.- Parameters:
nickname- the name of user- Returns:
- the user
-
findByName
Gets the user.- Parameters:
nickname- the name of userignoreCase- ignore the case of the nickname- Returns:
- the user
-
findByPlayer
Gets the user.- Returns:
- the user
-
findByPlayer
Gets the user.- Returns:
- the user
-
createFake
-
createFake
-
create
Create the user and add it to storage. If you think you should use this method you probably shouldn't - instead usefindByUuid(UUID),findByName(String)etc.- Parameters:
uuid- the universally unique identifier which will be assigned to username- the nickname which will be assigned to UseruserProfile- the user profile which will be assigned to User- Returns:
- the user
-
addUser
Add user to storage. If you think you should use this method you probably shouldn't.- Parameters:
user- user to add
-
removeUser
Remove user from storage. If you think you should use this method you probably shouldn't.- Parameters:
user- user to remove
-
updateUsername
Update username for user.- Parameters:
user- the user for which the nickname will be changednewUsername- the new nickname for user
-
playedBefore
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
Checks if user with given nickname have ever played on a server.- Parameters:
nickname- the nickname of user to check if ever played onignoreCase- ignore the case of the nickname- Returns:
- if user with given name have ever played on a server
-
getInstance
Deprecated.for removal in the future, in favour ofFunnyGuilds.getUserManager()Gets the user manager.- Returns:
- the user manager
-
FunnyGuilds.getUserManager()