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 void
addUser(User user)
Adds a user to this group.Entity
getEntity()
Gets the entity associated with this object.int
getGroupId()
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.int
hashCode()
void
setEntity(Entity entity)
void
setName(java.lang.String name)
void
setOwner(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:EntityType
Gets the entity associated with this object.- Specified by:
getEntity
in interfaceEntityType
- Returns:
- Associated entity.
-
setEntity
public void setEntity(Entity entity)
-
getName
public java.lang.String getName()
Description copied from interface:UserGroup
Gets the name of this group.
-
getOwner
public User getOwner()
Description copied from interface:UserGroup
Gets this group's owner.
-
getMembership
public java.util.Collection<UserGroupMembership> getMembership()
Description copied from interface:UserGroup
Gets a collection of individual memberships, which is more definite than getUsers(), providing more specific information about membership.- Specified by:
getMembership
in interfaceUserGroup
- Returns:
- immutable collection of user group membership records.
-
getMembership
public UserGroupMembership getMembership(User user)
Description copied from interface:UserGroup
Gets the membership record for a specific user.- Specified by:
getMembership
in 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:UserGroup
Adds 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:UserGroup
Sets the owner of this group.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-