Class GroupParentProvider

java.lang.Object
de.murmelmeister.murmelapi.group.parent.GroupParentProvider
All Implemented Interfaces:
GroupParent

public final class GroupParentProvider extends Object implements GroupParent
  • Field Details

  • Constructor Details

    • GroupParentProvider

      public GroupParentProvider()
  • Method Details

    • createTable

      private void createTable(String tableName)
    • existsParent

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

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

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

      public void clearParent(int groupId)
      Description copied from interface: GroupParent
      Clears all parents from a group.
      Specified by:
      clearParent in interface GroupParent
      Parameters:
      groupId - The id of the group.
    • getParentIds

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

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

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

      public long getCreatedTime(int groupId, int parentId)
      Description copied from interface: GroupParent
      Obtains the time the parent was created.
      Specified by:
      getCreatedTime in interface GroupParent
      Parameters:
      groupId - The id of the group.
      parentId - The id of the parent.
      Returns:
      The time the parent was created.
    • getCreatedDate

      public String getCreatedDate(int groupId, int parentId)
      Description copied from interface: GroupParent
      Obtains the date the parent was created.
      Specified by:
      getCreatedDate in interface GroupParent
      Parameters:
      groupId - The id of the group.
      parentId - The id of the parent.
      Returns:
      The date the parent was created.
    • getExpiredTime

      public long getExpiredTime(int groupId, int parentId)
      Description copied from interface: GroupParent
      Obtains the time the parent will expire.
      Specified by:
      getExpiredTime in interface GroupParent
      Parameters:
      groupId - The id of the group.
      parentId - The id of the parent.
      Returns:
      The time the parent will expire.
    • getExpiredDate

      public String getExpiredDate(int groupId, int parentId)
      Description copied from interface: GroupParent
      Obtains the date the parent will expire.
      Specified by:
      getExpiredDate in interface GroupParent
      Parameters:
      groupId - The id of the group.
      parentId - The id of the parent.
      Returns:
      The date the parent will expire.
    • setExpiredTime

      public String setExpiredTime(int groupId, int parentId, long time)
      Description copied from interface: GroupParent
      Sets the time the parent will expire.
      Specified by:
      setExpiredTime in interface GroupParent
      Parameters:
      groupId - The id of the group.
      parentId - The id of the parent.
      time - The time the parent will expire.
      Returns:
      The date the parent will expire.
    • addExpiredTime

      public String addExpiredTime(int groupId, int parentId, long time)
      Description copied from interface: GroupParent
      Adds time to the parent expiration.
      Specified by:
      addExpiredTime in interface GroupParent
      Parameters:
      groupId - The id of the group.
      parentId - The id of the parent.
      time - The time to add to the expiration.
      Returns:
      The date the parent will expire.
    • removeExpiredTime

      public String removeExpiredTime(int groupId, int parentId, long time)
      Description copied from interface: GroupParent
      Removes time from the parent expiration.
      Specified by:
      removeExpiredTime in interface GroupParent
      Parameters:
      groupId - The id of the group.
      parentId - The id of the parent.
      time - The time to remove from the expiration.
      Returns:
      The date the parent will expire.
    • loadExpired

      public void loadExpired(Group group)
      Description copied from interface: GroupParent
      Loads all expired parents of a group.
      Specified by:
      loadExpired in interface GroupParent
      Parameters:
      group - The group.