Class PermissionOverrideImpl
java.lang.Object
net.dv8tion.jda.internal.entities.PermissionOverrideImpl
- All Implemented Interfaces:
ISnowflake
,PermissionOverride
-
Constructor Summary
ConstructorsConstructorDescriptionPermissionOverrideImpl
(IPermissionContainer channel, long id, boolean isRole) -
Method Summary
Modifier and TypeMethodDescriptiondelete()
Deletes this PermissionOverride.boolean
EnumSet of allPermissions
that are specifically allowed by this override.long
This is the raw binary representation (as a base 10 long) of the permissions allowed by this override.TheGuildChannel
that this PermissionOverride affects.EnumSet of allPermissions
that are denied by this override.long
This is the raw binary representation (as a base 10 long) of the permissions denied by this override.getGuild()
long
The Snowflake id of this entity.EnumSet of allPermission
that are unaffected by this override.long
This is the raw binary representation (as a base 10 long) of the permissions not affected by this override.getJDA()
TheJDA
instance that this PermissionOverride is related to.Returns thePermissionOverrideAction
to modify this PermissionOverride.This method will return thePermissionHolder
of this PermissionOverride.getRole()
int
hashCode()
boolean
Used to determine if this PermissionOverride relates to a specificMember
.boolean
Used to determine if this PermissionOverride relates to a specificRole
.setAllow
(long allow) setDeny
(long deny) toString()
Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getTimeCreated
-
Constructor Details
-
PermissionOverrideImpl
-
-
Method Details
-
getAllowedRaw
public long getAllowedRaw()Description copied from interface:PermissionOverride
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
.- Specified by:
getAllowedRaw
in interfacePermissionOverride
- Returns:
- Never-negative long containing the binary representation of the allowed permissions of this override.
-
getInheritRaw
public long getInheritRaw()Description copied from interface:PermissionOverride
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
.- Specified by:
getInheritRaw
in interfacePermissionOverride
- Returns:
- Never-negative long containing the binary representation of the unaffected permissions of this override.
-
getDeniedRaw
public long getDeniedRaw()Description copied from interface:PermissionOverride
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
.- Specified by:
getDeniedRaw
in interfacePermissionOverride
- Returns:
- Never-negative long containing the binary representation of the denied permissions of this override.
-
getAllowed
Description copied from interface:PermissionOverride
EnumSet of allPermissions
that are specifically allowed by this override.
Changes to the returned set do not affect this entity directly.- Specified by:
getAllowed
in interfacePermissionOverride
- Returns:
- Possibly-empty set of allowed
Permissions
.
-
getInherit
Description copied from interface:PermissionOverride
EnumSet of allPermission
that are unaffected by this override.
Changes to the returned set do not affect this entity directly.- Specified by:
getInherit
in interfacePermissionOverride
- Returns:
- Possibly-empty set of unaffected
Permissions
.
-
getDenied
Description copied from interface:PermissionOverride
EnumSet of allPermissions
that are denied by this override.
Changes to the returned set do not affect this entity directly.- Specified by:
getDenied
in interfacePermissionOverride
- Returns:
- Possibly-empty set of denied
Permissions
.
-
getJDA
Description copied from interface:PermissionOverride
TheJDA
instance that this PermissionOverride is related to.- Specified by:
getJDA
in interfacePermissionOverride
- Returns:
- Never-null
JDA
instance.
-
getPermissionHolder
Description copied from interface:PermissionOverride
This method will return thePermissionHolder
of this PermissionOverride. It can be used to get the general permissions of that PermissionHolder, no matter if it is aMember
or aRole
.
Similar toPermissionOverride.getMember()
this will returnnull
if the member is not cached.To get the concrete Member or Role, use
PermissionOverride.getMember()
orPermissionOverride.getRole()
!- Specified by:
getPermissionHolder
in interfacePermissionOverride
- Returns:
- Possibly-null
IPermissionHolder
of this PermissionOverride. - See Also:
-
getMember
Description copied from interface:PermissionOverride
If this PermissionOverride is an override dealing with aMember
, then this method will return the relatedMember
if the member is currently cached.
Otherwise, this method returnsnull
.
Basically: ifPermissionOverride.isMemberOverride()
returnsfalse
or the member is not cached, this returnsnull
.- Specified by:
getMember
in interfacePermissionOverride
- Returns:
- Possibly-null related
Member
.
-
getRole
Description copied from interface:PermissionOverride
If this PermissionOverride is an override dealing with aRole
, then this method will return the relatedRole
.
Otherwise, this method returnsnull
.
Basically: ifPermissionOverride.isRoleOverride()
returnsfalse
, this returnsnull
.- Specified by:
getRole
in interfacePermissionOverride
- Returns:
- Possibly-null related
Role
.
-
getChannel
Description copied from interface:PermissionOverride
TheGuildChannel
that this PermissionOverride affects.- Specified by:
getChannel
in interfacePermissionOverride
- Returns:
- Never-null related
GuildChannel
that this override is part of.
-
getGuild
Description copied from interface:PermissionOverride
TheGuild
that theGuildChannel
returned fromPermissionOverride.getChannel()
is a part of. By inference, this is theGuild
that this PermissionOverride is part of.- Specified by:
getGuild
in interfacePermissionOverride
- Returns:
- Never-null related
Guild
.
-
isMemberOverride
public boolean isMemberOverride()Description copied from interface:PermissionOverride
Used to determine if this PermissionOverride relates to a specificMember
.- Specified by:
isMemberOverride
in interfacePermissionOverride
- Returns:
- True if this override is a user override.
-
isRoleOverride
public boolean isRoleOverride()Description copied from interface:PermissionOverride
Used to determine if this PermissionOverride relates to a specificRole
.- Specified by:
isRoleOverride
in interfacePermissionOverride
- Returns:
- True if this override is a role override.
-
getManager
Description copied from interface:PermissionOverride
Returns thePermissionOverrideAction
to 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()
.- Specified by:
getManager
in interfacePermissionOverride
- Returns:
- The PermissionOverrideAction of this override.
-
delete
Description copied from interface:PermissionOverride
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
- Specified by:
delete
in interfacePermissionOverride
- Returns:
AuditableRestAction
-
getIdLong
public long getIdLong()Description copied from interface:ISnowflake
The Snowflake id of this entity. This is unique to every entity and will never change.- Specified by:
getIdLong
in interfaceISnowflake
- Returns:
- Long containing the Id.
-
setAllow
-
setDeny
-
equals
-
hashCode
public int hashCode() -
toString
-