Class UserProvider

java.lang.Object
de.murmelmeister.murmelapi.user.UserProvider
All Implemented Interfaces:
User

public final class UserProvider extends Object implements User
  • Field Details

  • Constructor Details

    • UserProvider

      public UserProvider()
  • Method Details

    • createTable

      private void createTable(String tableName)
    • existsUser

      public boolean existsUser(UUID uuid)
      Description copied from interface: User
      Checks if a user exists.
      Specified by:
      existsUser in interface User
      Parameters:
      uuid - The unique id of the user.
      Returns:
      True if the user exists, otherwise false.
    • existsUser

      public boolean existsUser(String username)
      Description copied from interface: User
      Checks if a user exists.
      Specified by:
      existsUser in interface User
      Parameters:
      username - The username of the user.
      Returns:
      True if the user exists, otherwise false.
    • createNewUser

      public void createNewUser(UUID uuid, String username)
      Description copied from interface: User
      Create a new user and check if the user already exists. If the user already exists, the method will return without creating a new user.
      Specified by:
      createNewUser in interface User
      Parameters:
      uuid - The unique id of the user.
      username - The username of the user.
    • deleteUser

      public void deleteUser(UUID uuid)
      Description copied from interface: User
      Deletes a user.
      Specified by:
      deleteUser in interface User
      Parameters:
      uuid - The unique id of the user.
    • getId

      public int getId(UUID uuid)
      Description copied from interface: User
      Obtains the id of a user.
      Specified by:
      getId in interface User
      Parameters:
      uuid - The unique id of the user.
      Returns:
      The id of the user.
    • getId

      public int getId(String username)
      Description copied from interface: User
      Obtains the id of a user.
      Specified by:
      getId in interface User
      Parameters:
      username - The username of the user.
      Returns:
      The id of the user.
    • getUniqueId

      public UUID getUniqueId(String username)
      Description copied from interface: User
      Obtains the unique id of a user.
      Specified by:
      getUniqueId in interface User
      Parameters:
      username - The username of the user.
      Returns:
      The unique id of the user.
    • getUniqueId

      public UUID getUniqueId(int id)
      Description copied from interface: User
      Obtains the unique id of a user.
      Specified by:
      getUniqueId in interface User
      Parameters:
      id - The id of the user.
      Returns:
      The unique id of the user.
    • getUsername

      public String getUsername(UUID uuid)
      Description copied from interface: User
      Obtains the username of a user.
      Specified by:
      getUsername in interface User
      Parameters:
      uuid - The unique id of the user.
      Returns:
      The username of the user.
    • getUsername

      public String getUsername(int id)
      Description copied from interface: User
      Obtains the username of a user. If the id -1 then the method will return "CONSOLE".
      Specified by:
      getUsername in interface User
      Parameters:
      id - The id of the user.
      Returns:
      The username of the user.
    • rename

      public void rename(UUID uuid, String newName)
      Description copied from interface: User
      Renames a user.
      Specified by:
      rename in interface User
      Parameters:
      uuid - The unique id of the user.
      newName - The new username of the user.
    • getUniqueIds

      public List<UUID> getUniqueIds()
      Description copied from interface: User
      Obtains a list of all unique ids.
      Specified by:
      getUniqueIds in interface User
      Returns:
      A list of all unique ids.
    • getUsernames

      public List<String> getUsernames()
      Description copied from interface: User
      Obtains a list of all usernames.
      Specified by:
      getUsernames in interface User
      Returns:
      A list of all usernames.
    • getIds

      public List<Integer> getIds()
      Description copied from interface: User
      Obtains a list of all ids.
      Specified by:
      getIds in interface User
      Returns:
      A list of all ids.
    • joinUser

      public void joinUser(UUID uuid, String username)
      Description copied from interface: User
      Join a user to the server. Create a new user if the user does not exist. Check if the user changes their name and rename them.
      Specified by:
      joinUser in interface User
      Parameters:
      uuid - The unique id of the user.
      username - The username of the user.
    • loadExpired

      public void loadExpired()
      Description copied from interface: User
      Load all expired things.
      Specified by:
      loadExpired in interface User
    • getSettings

      public UserSettings getSettings()
      Description copied from interface: User
      Obtains the settings of a user.
      Specified by:
      getSettings in interface User
      Returns:
      The settings of the user.
    • getParent

      public UserParent getParent()
      Description copied from interface: User
      Obtains the parent of a user.
      Specified by:
      getParent in interface User
      Returns:
      The parent of the user.
    • getPermission

      public UserPermission getPermission()
      Description copied from interface: User
      Obtains the permission of a user.
      Specified by:
      getPermission in interface User
      Returns:
      The permission of the user.
    • getPlayTime

      public PlayTime getPlayTime()
      Description copied from interface: User
      Obtains the play time of a user.
      Specified by:
      getPlayTime in interface User
      Returns:
      The play time of the user.