Package net.dv8tion.jda.api.entities
Interface PermissionOverride
-
- All Superinterfaces:
ISnowflake
public interface PermissionOverride extends ISnowflake
- See Also:
GuildChannel.upsertPermissionOverride(IPermissionHolder),GuildChannel.createPermissionOverride(IPermissionHolder),GuildChannel.putPermissionOverride(IPermissionHolder),GuildChannel.getPermissionOverrides(),GuildChannel.getPermissionOverride(IPermissionHolder),GuildChannel.getMemberPermissionOverrides(),GuildChannel.getRolePermissionOverrides()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AuditableRestAction<Void>delete()Deletes this PermissionOverride.EnumSet<Permission>getAllowed()EnumSet of allPermissionsthat are specifically allowed by this override.longgetAllowedRaw()This is the raw binary representation (as a base 10 long) of the permissions allowed by this override.GuildChannelgetChannel()TheGuildChannelthat thisPermissionOverrideaffects.EnumSet<Permission>getDenied()EnumSet of allPermissionsthat are denied by this override.longgetDeniedRaw()This is the raw binary representation (as a base 10 long) of the permissions denied by this override.GuildgetGuild()EnumSet<Permission>getInherit()EnumSet of allPermissionthat are unaffected by this override.longgetInheritRaw()This is the raw binary representation (as a base 10 long) of the permissions not affected by this override.JDAgetJDA()TheJDAinstance that thisPermissionOverrideis related to.PermissionOverrideActiongetManager()Returns thePermissionOverrideActionto modify this PermissionOverride.MembergetMember()If thisPermissionOverrideis an override dealing with aMember, then this method will return the relatedMember.RolegetRole()If thisPermissionOverrideis an override dealing with aRole, then this method will return the relatedRole.booleanisMemberOverride()Used to determine if thisPermissionOverriderelates to a specificMember.booleanisRoleOverride()Used to determine if thisPermissionOverriderelates to a specificRole.-
Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreated
-
-
-
-
Method Detail
-
getAllowedRaw
long getAllowedRaw()
This is the raw binary representation (as a base 10 long) of the permissions allowed by this override.
The long relates to the offsets used by eachPermission.- Returns:
- Never-negative long containing the binary representation of the allowed permissions of this override.
-
getInheritRaw
long getInheritRaw()
This is the raw binary representation (as a base 10 long) of the permissions not affected by this override.
The long relates to the offsets used by eachPermission.- Returns:
- Never-negative long containing the binary representation of the unaffected permissions of this override.
-
getDeniedRaw
long getDeniedRaw()
This is the raw binary representation (as a base 10 long) of the permissions denied by this override.
The long relates to the offsets used by eachPermission.- Returns:
- Never-negative long containing the binary representation of the denied permissions of this override.
-
getAllowed
@Nonnull EnumSet<Permission> getAllowed()
EnumSet of allPermissionsthat are specifically allowed by this override.
Changes to the returned set do not affect this entity directly.- Returns:
- Possibly-empty set of allowed
Permissions.
-
getInherit
@Nonnull EnumSet<Permission> getInherit()
EnumSet of allPermissionthat are unaffected by this override.
Changes to the returned set do not affect this entity directly.- Returns:
- Possibly-empty set of unaffected
Permissions.
-
getDenied
@Nonnull EnumSet<Permission> getDenied()
EnumSet of allPermissionsthat are denied by this override.
Changes to the returned set do not affect this entity directly.- Returns:
- Possibly-empty set of denied
Permissions.
-
getJDA
@Nonnull JDA getJDA()
TheJDAinstance that thisPermissionOverrideis related to.- Returns:
- Never-null
JDAinstance.
-
getMember
@Nullable Member getMember()
If thisPermissionOverrideis an override dealing with aMember, then this method will return the relatedMember.
Otherwise, this method returnsnull.
Basically: ifisMemberOverride()returnsfalse, this returnsnull.- Returns:
- Possibly-null related
Member.
-
getRole
@Nullable Role getRole()
If thisPermissionOverrideis an override dealing with aRole, then this method will return the relatedRole.
Otherwise, this method returnsnull. Basically: ifisRoleOverride()returnsfalse, this returnsnull.- Returns:
- Possibly-null related
Role.
-
getChannel
@Nonnull GuildChannel getChannel()
TheGuildChannelthat thisPermissionOverrideaffects.- Returns:
- Never-null related
GuildChannelthat this override is part of.
-
getGuild
@Nonnull Guild getGuild()
TheGuildthat theGuildChannelreturned fromgetChannel()is a part of. By inference, this is theGuildthat thisPermissionOverrideis part of.- Returns:
- Never-null related
Guild.
-
isMemberOverride
boolean isMemberOverride()
Used to determine if thisPermissionOverriderelates to a specificMember.- Returns:
- True if this override is a user override.
-
isRoleOverride
boolean isRoleOverride()
Used to determine if thisPermissionOverriderelates to a specificRole.- Returns:
- True if this override is a role override.
-
getManager
@Nonnull PermissionOverrideAction getManager()
Returns thePermissionOverrideActionto modify this PermissionOverride.
In the PermissionOverrideAction you can modify the permissions of the override. You modify multiple fields in one request by chaining setters before callingRestAction.queue().- Returns:
- The PermissionOverrideAction of this override.
- Throws:
InsufficientPermissionException- If the currently logged in account does not havePermission.MANAGE_PERMISSIONS
-
delete
@Nonnull @CheckReturnValue AuditableRestAction<Void> delete()
Deletes this PermissionOverride.Possible ErrorResponses include:
ErrorResponse.UNKNOWN_OVERRIDE
If the the override was already deleted.UNKNOWN_CHANNEL
If the channel this override was a part of was already deletedMISSING_ACCESS
If we were removed from the Guild
- Returns:
AuditableRestAction- Throws:
InsufficientPermissionException- if we don't have the permission toMANAGE_CHANNEL
-
-