Interface UserParent

All Known Implementing Classes:
UserParentProvider

public sealed interface UserParent permits UserParentProvider
User parent interface to manage user parents.
  • Method Summary

    Modifier and Type
    Method
    Description
    addExpiredTime(int userId, int parentId, long time)
    Adds an expired time to a parent.
    void
    addParent(int userId, int creatorId, int parentId, long time)
    Adds a parent to a user.
    void
    clearParent(int userId)
    Clears all parents from a user.
    boolean
    existsParent(int userId, int parentId)
    Checks if a parent exists.
    getCreatedDate(int userId, int parentId)
    Obtains the created date of a parent.
    long
    getCreatedTime(int userId, int parentId)
    Obtains the created time of a parent.
    int
    getCreatorId(int userId, int parentId)
    Obtains the creator id of a parent.
    getExpiredDate(int userId, int parentId)
    Obtains the expired date of a parent.
    long
    getExpiredTime(int userId, int parentId)
    Obtains the expired time of a parent.
    int
    getParentId(int userId)
    Obtains the parent id of a user.
    getParentIds(int userId)
    Obtains all parent ids of a user.
    getParentNames(Group group, int userId)
    Obtains all parent names of a user.
    void
    Loads all expired parents of a user.
    removeExpiredTime(int userId, int parentId, long time)
    Removes an expired time from a parent.
    void
    removeParent(int userId, int parentId)
    Removes a parent from a user.
    setExpiredTime(int userId, int parentId, long time)
    Sets the expired time of a parent.
  • Method Details

    • existsParent

      boolean existsParent(int userId, int parentId)
      Checks if a parent exists.
      Parameters:
      userId - The id of the user.
      parentId - The id of the parent.
      Returns:
      True if the parent exists, otherwise false.
    • addParent

      void addParent(int userId, int creatorId, int parentId, long time)
      Adds a parent to a user.
      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

      void removeParent(int userId, int parentId)
      Removes a parent from a user.
      Parameters:
      userId - The id of the user.
      parentId - The id of the parent.
    • clearParent

      void clearParent(int userId)
      Clears all parents from a user.
      Parameters:
      userId - The id of the user.
    • getParentId

      int getParentId(int userId)
      Obtains the parent id of a user.
      Parameters:
      userId - The id of the user.
      Returns:
      The parent id of the user.
    • getParentIds

      List<Integer> getParentIds(int userId)
      Obtains all parent ids of a user.
      Parameters:
      userId - The id of the user.
      Returns:
      A list of all parent ids of the user.
    • getParentNames

      List<String> getParentNames(Group group, int userId)
      Obtains all parent names of a user.
      Parameters:
      group - The group.
      userId - The id of the user.
      Returns:
      A list of all parent names of the user.
    • getCreatorId

      int getCreatorId(int userId, int parentId)
      Obtains the creator id of a parent.
      Parameters:
      userId - The id of the user.
      parentId - The id of the parent.
      Returns:
      The creator id of the parent.
    • getCreatedTime

      long getCreatedTime(int userId, int parentId)
      Obtains the created time of a parent.
      Parameters:
      userId - The id of the user.
      parentId - The id of the parent.
      Returns:
      The created time of the parent.
    • getCreatedDate

      String getCreatedDate(int userId, int parentId)
      Obtains the created date of a parent.
      Parameters:
      userId - The id of the user.
      parentId - The id of the parent.
      Returns:
      The created date of the parent.
    • getExpiredTime

      long getExpiredTime(int userId, int parentId)
      Obtains the expired time of a parent.
      Parameters:
      userId - The id of the user.
      parentId - The id of the parent.
      Returns:
      The expired time of the parent.
    • getExpiredDate

      String getExpiredDate(int userId, int parentId)
      Obtains the expired date of a parent.
      Parameters:
      userId - The id of the user.
      parentId - The id of the parent.
      Returns:
      The expired date of the parent.
    • setExpiredTime

      String setExpiredTime(int userId, int parentId, long time)
      Sets the expired time of a parent.
      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

      String addExpiredTime(int userId, int parentId, long time)
      Adds an expired time to a parent.
      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

      String removeExpiredTime(int userId, int parentId, long time)
      Removes an expired time from a parent.
      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

      void loadExpired(User user)
      Loads all expired parents of a user.
      Parameters:
      user - The user.