Class UserParentProvider

java.lang.Object
de.murmelmeister.murmelapi.user.parent.UserParentProvider
All Implemented Interfaces:
UserParent

public final class UserParentProvider extends Object implements UserParent
  • Field Details

  • Constructor Details

    • UserParentProvider

      public UserParentProvider()
  • Method Details

    • createTable

      private void createTable(String tableName)
    • existsParent

      public boolean existsParent(int userId, int parentId)
      Description copied from interface: UserParent
      Checks if a parent exists.
      Specified by:
      existsParent in interface UserParent
      Parameters:
      userId - The id of the user.
      parentId - The id of the parent.
      Returns:
      True if the parent exists, otherwise false.
    • addParent

      public void addParent(int userId, int creatorId, int parentId, long time)
      Description copied from interface: UserParent
      Adds a parent to a user.
      Specified by:
      addParent in interface UserParent
      Parameters:
      userId - The id of the user.
      creatorId - The id of the creator.
      parentId - The id of the parent.
      time - The time the parent was added.
    • removeParent

      public void removeParent(int userId, int parentId)
      Description copied from interface: UserParent
      Removes a parent from a user.
      Specified by:
      removeParent in interface UserParent
      Parameters:
      userId - The id of the user.
      parentId - The id of the parent.
    • clearParent

      public void clearParent(int userId)
      Description copied from interface: UserParent
      Clears all parents from a user.
      Specified by:
      clearParent in interface UserParent
      Parameters:
      userId - The id of the user.
    • getParentId

      public int getParentId(int userId)
      Description copied from interface: UserParent
      Obtains the parent id of a user.
      Specified by:
      getParentId in interface UserParent
      Parameters:
      userId - The id of the user.
      Returns:
      The parent id of the user.
    • getParentIds

      public List<Integer> getParentIds(int userId)
      Description copied from interface: UserParent
      Obtains all parent ids of a user.
      Specified by:
      getParentIds in interface UserParent
      Parameters:
      userId - The id of the user.
      Returns:
      A list of all parent ids of the user.
    • getParentNames

      public List<String> getParentNames(Group group, int userId)
      Description copied from interface: UserParent
      Obtains all parent names of a user.
      Specified by:
      getParentNames in interface UserParent
      Parameters:
      group - The group.
      userId - The id of the user.
      Returns:
      A list of all parent names of the user.
    • getCreatorId

      public int getCreatorId(int userId, int parentId)
      Description copied from interface: UserParent
      Obtains the creator id of a parent.
      Specified by:
      getCreatorId in interface UserParent
      Parameters:
      userId - The id of the user.
      parentId - The id of the parent.
      Returns:
      The creator id of the parent.
    • getCreatedTime

      public long getCreatedTime(int userId, int parentId)
      Description copied from interface: UserParent
      Obtains the created time of a parent.
      Specified by:
      getCreatedTime in interface UserParent
      Parameters:
      userId - The id of the user.
      parentId - The id of the parent.
      Returns:
      The created time of the parent.
    • getCreatedDate

      public String getCreatedDate(int userId, int parentId)
      Description copied from interface: UserParent
      Obtains the created date of a parent.
      Specified by:
      getCreatedDate in interface UserParent
      Parameters:
      userId - The id of the user.
      parentId - The id of the parent.
      Returns:
      The created date of the parent.
    • getExpiredTime

      public long getExpiredTime(int userId, int parentId)
      Description copied from interface: UserParent
      Obtains the expired time of a parent.
      Specified by:
      getExpiredTime in interface UserParent
      Parameters:
      userId - The id of the user.
      parentId - The id of the parent.
      Returns:
      The expired time of the parent.
    • getExpiredDate

      public String getExpiredDate(int userId, int parentId)
      Description copied from interface: UserParent
      Obtains the expired date of a parent.
      Specified by:
      getExpiredDate in interface UserParent
      Parameters:
      userId - The id of the user.
      parentId - The id of the parent.
      Returns:
      The expired date of the parent.
    • setExpiredTime

      public String setExpiredTime(int userId, int parentId, long time)
      Description copied from interface: UserParent
      Sets the expired time of a parent.
      Specified by:
      setExpiredTime in interface UserParent
      Parameters:
      userId - The id of the user.
      parentId - The id of the parent.
      time - The time the parent expires.
      Returns:
      The date the parent will expire.
    • addExpiredTime

      public String addExpiredTime(int userId, int parentId, long time)
      Description copied from interface: UserParent
      Adds an expired time to a parent.
      Specified by:
      addExpiredTime in interface UserParent
      Parameters:
      userId - The id of the user.
      parentId - The id of the parent.
      time - The time to add to the expired time.
      Returns:
      The date the parent will expire.
    • removeExpiredTime

      public String removeExpiredTime(int userId, int parentId, long time)
      Description copied from interface: UserParent
      Removes an expired time from a parent.
      Specified by:
      removeExpiredTime in interface UserParent
      Parameters:
      userId - The id of the user.
      parentId - The id of the parent.
      time - The time to remove from the expired time.
      Returns:
      The date the parent will expire.
    • loadExpired

      public void loadExpired(User user)
      Description copied from interface: UserParent
      Loads all expired parents of a user.
      Specified by:
      loadExpired in interface UserParent
      Parameters:
      user - The user.