Package com.mewna.catnip.entity.partials
Interface Permissable
- All Superinterfaces:
Entity
,GuildEntity
,HasGuild
,Snowflake
,Timestamped
- All Known Subinterfaces:
InteractionMember
,Member
,Role
- All Known Implementing Classes:
InteractionMemberImpl
,MemberImpl
,RoleImpl
An entity which is permission-scoped in catnip.
- Since:
- 13/2/19.
- Author:
- schlaubi
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.mewna.catnip.entity.partials.Timestamped
Timestamped.TimestampStyle
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canInteract
(Member member) Checks whether the entity can interact with a member or not.boolean
canInteract
(Role role) Checks whether the entity can interact with a role or not.default boolean
hasPermissions
(GuildChannel channel, Permission... permissions) Checks whether the entity has the permissions or not in a specificGuildChannel
.boolean
hasPermissions
(GuildChannel channel, Collection<Permission> permissions) Checks whether the entity has the permissions or not in a specificGuildChannel
.default boolean
hasPermissions
(Permission... permissions) Checks whether the entity has the permissions or not.boolean
hasPermissions
(Collection<Permission> permissions) Checks whether the entity has the permissions or not.Returns a list of the entity's permissions.default long
Returns the raw permissions of the entity as a long.Methods inherited from interface com.mewna.catnip.entity.partials.GuildEntity
guild
Methods inherited from interface com.mewna.catnip.entity.partials.HasGuild
guildId, guildIdAsLong
Methods inherited from interface com.mewna.catnip.entity.partials.Snowflake
creationTime, creationTimestamp, id, idAsLong
Methods inherited from interface com.mewna.catnip.entity.partials.Timestamped
asDiscordTimestamp, parseTimestamp
-
Method Details
-
permissions
Set<Permission> permissions()Returns a list of the entity's permissions.- Returns:
- a list of the entity's permissions
-
permissionsRaw
default long permissionsRaw()Returns the raw permissions of the entity as a long.- Returns:
- the raw permissions of the entity as a long
-
hasPermissions
Checks whether the entity has the permissions or not.- Parameters:
permissions
- The permissions to check.- Returns:
- Whether the entity has the permissions or not
-
hasPermissions
Checks whether the entity has the permissions or not.- Parameters:
permissions
- The permissions to check.- Returns:
- Whether the entity has the permissions or not
-
hasPermissions
Checks whether the entity has the permissions or not in a specificGuildChannel
.- Parameters:
channel
- The channel in which the entity should have the permissionpermissions
- The permissions to check.- Returns:
- Whether the entity has the permissions or not
-
hasPermissions
Checks whether the entity has the permissions or not in a specificGuildChannel
.- Parameters:
channel
- The channel in which the entity should have the permission.permissions
- The permissions to check.- Returns:
- Whether the entity has the permissions or not
-
canInteract
Checks whether the entity can interact with a role or not.- Parameters:
role
- The role the entity should interact with.- Returns:
- Whether the entity can interact with a role or not
-
canInteract
Checks whether the entity can interact with a member or not.- Parameters:
member
- The member the entity should interact with.- Returns:
- Whether the entity can interact with a member or not
-