Package io.manebot.user
Interface UserGroup
-
- All Superinterfaces:
EntityType
- All Known Implementing Classes:
Group
public interface UserGroup extends EntityType
-
-
Method Summary
Modifier and Type Method Description void
addUser(User user)
Adds a user to this group.java.util.Collection<UserGroupMembership>
getMembership()
Gets a collection of individual memberships, which is more definite than getUsers(), providing more specific information about membership.UserGroupMembership
getMembership(User user)
Gets the membership record for a specific user.java.lang.String
getName()
Gets the name of this group.User
getOwner()
Gets this group's owner.default java.util.Collection<User>
getUsers()
Gets the users in this group.default boolean
isMember(User user)
Finds if the specified user is a member of this group.default void
removeUser(User user)
Removes a user from this group.void
setOwner(User user)
Sets the owner of this group.-
Methods inherited from interface io.manebot.entity.EntityType
checkPermission, checkPermission, checkPermission, checkPermission, getEntity, hasPermission, hasPermission, hasPermission, hasPermission
-
-
-
-
Method Detail
-
getName
java.lang.String getName()
Gets the name of this group.- Returns:
- group name.
-
getOwner
User getOwner()
Gets this group's owner.- Returns:
- owner.
-
getUsers
default java.util.Collection<User> getUsers()
Gets the users in this group.- Returns:
- users in the group.
-
getMembership
java.util.Collection<UserGroupMembership> getMembership()
Gets a collection of individual memberships, which is more definite than getUsers(), providing more specific information about membership.- Returns:
- immutable collection of user group membership records.
-
setOwner
void setOwner(User user) throws java.lang.SecurityException
Sets the owner of this group.- Parameters:
user
- user to set as the new owner of this group.- Throws:
java.lang.SecurityException
- if there is a security violation adding the user.
-
isMember
default boolean isMember(User user)
Finds if the specified user is a member of this group.- Parameters:
user
- User to check in the group.- Returns:
- true if the user is a member of the group, false otherwise.
-
getMembership
UserGroupMembership getMembership(User user)
Gets the membership record for a specific user.- Parameters:
user
- User to search membership records for.- Returns:
- membership instance.
-
addUser
void addUser(User user) throws java.lang.SecurityException
Adds a user to this group.- Parameters:
user
- user to add.- Throws:
java.lang.SecurityException
- if there is a security violation adding the user.
-
removeUser
default void removeUser(User user) throws java.lang.SecurityException
Removes a user from this group.- Parameters:
user
- user to remove.- Throws:
java.lang.SecurityException
- if there is a security violation removing the user.
-
-