Package io.manebot.database.model
Class Group
- java.lang.Object
-
- io.manebot.database.model.TimedRow
-
- io.manebot.database.model.Group
-
- All Implemented Interfaces:
EntityType,UserGroup
@Entity public class Group extends TimedRow implements UserGroup
-
-
Method Summary
Modifier and Type Method Description voidaddUser(User user)Adds a user to this group.EntitygetEntity()Gets the entity associated with this object.intgetGroupId()java.util.Collection<UserGroupMembership>getMembership()Gets a collection of individual memberships, which is more definite than getUsers(), providing more specific information about membership.UserGroupMembershipgetMembership(User user)Gets the membership record for a specific user.java.lang.StringgetName()Gets the name of this group.UsergetOwner()Gets this group's owner.inthashCode()voidsetEntity(Entity entity)voidsetName(java.lang.String name)voidsetOwner(User user)Sets the owner of this group.-
Methods inherited from class io.manebot.database.model.TimedRow
getCreated, getCreatedDate, getUpdated, getUpdatedDate, setCreated, setCreated, setCreatedDate, setUpdated, setUpdated, setUpdatedDate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.manebot.entity.EntityType
checkPermission, checkPermission, checkPermission, checkPermission, hasPermission, hasPermission, hasPermission, hasPermission
-
Methods inherited from interface io.manebot.user.UserGroup
getUsers, isMember, removeUser
-
-
-
-
Method Detail
-
getEntity
public Entity getEntity()
Description copied from interface:EntityTypeGets the entity associated with this object.- Specified by:
getEntityin interfaceEntityType- Returns:
- Associated entity.
-
setEntity
public void setEntity(Entity entity)
-
getName
public java.lang.String getName()
Description copied from interface:UserGroupGets the name of this group.
-
getOwner
public User getOwner()
Description copied from interface:UserGroupGets this group's owner.
-
getMembership
public java.util.Collection<UserGroupMembership> getMembership()
Description copied from interface:UserGroupGets a collection of individual memberships, which is more definite than getUsers(), providing more specific information about membership.- Specified by:
getMembershipin interfaceUserGroup- Returns:
- immutable collection of user group membership records.
-
getMembership
public UserGroupMembership getMembership(User user)
Description copied from interface:UserGroupGets the membership record for a specific user.- Specified by:
getMembershipin interfaceUserGroup- Parameters:
user- User to search membership records for.- Returns:
- membership instance.
-
addUser
public void addUser(User user) throws java.lang.SecurityException
Description copied from interface:UserGroupAdds a user to this group.
-
setName
public void setName(java.lang.String name)
-
getGroupId
public int getGroupId()
-
setOwner
public void setOwner(User user)
Description copied from interface:UserGroupSets the owner of this group.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-