public class PermissionOverrideAction extends AuditableRestAction<PermissionOverride>
RestAction
specifically
designed to create a PermissionOverride
for a Channel
.
This extension allows setting properties before executing the action.AuditableRestAction.EmptyRestAction<T>, AuditableRestAction.FailedRestAction<T>
DEFAULT_FAILURE, DEFAULT_SUCCESS, LOG
Constructor and Description |
---|
PermissionOverrideAction(JDA api,
net.dv8tion.jda.core.requests.Route.CompiledRoute route,
Channel channel,
Member member)
Creates a new PermissionOverrideAction instance
|
PermissionOverrideAction(JDA api,
net.dv8tion.jda.core.requests.Route.CompiledRoute route,
Channel channel,
Role role)
Creates a new PermissionOverrideAction instance
|
Modifier and Type | Method and Description |
---|---|
long |
getAllow()
The currently set of allowed permission bits.
|
java.util.List<Permission> |
getAllowedPermissions()
Immutable list of
Permissions
that would be granted by the PermissionOverride that is created by this action. |
java.util.List<Permission> |
getDeniedPermissions()
Immutable list of
Permissions
that would be denied by the PermissionOverride that is created by this action. |
long |
getDeny()
The currently set of denied permission bits.
|
long |
getInherited()
The currently set of inherited permission bits.
|
java.util.List<Permission> |
getInheritedPermissions()
Immutable list of
Permissions
that would be inherited from other permission holders. |
boolean |
isMember()
Whether this Action will
create a
PermissionOverride
for a Member or not |
boolean |
isRole()
Whether this Action will
create a
PermissionOverride
for a Role or not |
PermissionOverrideAction |
setAllow(java.util.Collection<Permission> permissions)
Sets the value of explicitly granted permissions
using a Collection of
Permissions . |
PermissionOverrideAction |
setAllow(long allowBits)
Sets the value of explicitly granted permissions
using the bitwise representation of a set of
Permissions . |
PermissionOverrideAction |
setAllow(Permission... permissions)
Sets the value of explicitly granted permissions
using a set of
Permissions . |
PermissionOverrideAction |
setDeny(java.util.Collection<Permission> permissions)
Sets the value of explicitly denied permissions
using a Collection of
Permissions . |
PermissionOverrideAction |
setDeny(long denyBits)
Sets the value of explicitly denied permissions
using the bitwise representation of a set of
Permissions . |
PermissionOverrideAction |
setDeny(Permission... permissions)
Sets the value of explicitly denied permissions
using a set of
Permissions . |
PermissionOverrideAction |
setPermissions(java.util.Collection<Permission> grantPermissions,
java.util.Collection<Permission> denyPermissions)
Combination of
setAllow(java.util.Collection) and setDeny(java.util.Collection)
If a passed collection is null it resets the represented value to 0 - no permission specifics. |
PermissionOverrideAction |
setPermissions(long allowBits,
long denyBits)
Combination of
setAllow(long) and setDeny(long) |
reason
complete, complete, completeAfter, getJDA, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, submit, submit, submitAfter, submitAfter
public PermissionOverrideAction(JDA api, net.dv8tion.jda.core.requests.Route.CompiledRoute route, Channel channel, Member member)
public long getAllow()
Use getAllowedPermissions()
to retrieve a List
with Permissions
for this value
public java.util.List<Permission> getAllowedPermissions()
Permissions
that would be granted by the PermissionOverride that is created by this action.Permissions
public long getDeny()
Use getDeniedPermissions()
to retrieve a List
with Permissions
for this value
public java.util.List<Permission> getDeniedPermissions()
Permissions
that would be denied by the PermissionOverride that is created by this action.Permissions
public long getInherited()
Use getInheritedPermissions()
to retrieve a List
with Permissions
for this value
public java.util.List<Permission> getInheritedPermissions()
Permissions
that would be inherited from other permission holders.
Permissions
getInherited()
public boolean isMember()
PermissionOverride
for a Member
or notpublic boolean isRole()
PermissionOverride
for a Role
or notfalse
it is targeting a Member
. (isMember()
)@CheckReturnValue public PermissionOverrideAction setAllow(long allowBits)
Permissions
.
Permissions.getRaw(Permission...)
!
isChannel()
will have no affect!allowBits
- The positive bits representing the granted
permissions for the new PermissionOverridejava.lang.IllegalArgumentException
- If the provided bits are negative
or higher than Permission.ALL_PERMISSIONS
@CheckReturnValue public PermissionOverrideAction setAllow(java.util.Collection<Permission> permissions)
Permissions
.
isChannel()
will have no affect!permissions
- The Collection of Permissions representing the granted
permissions for the new PermissionOverride.
null
the permissions are reset to the default of nonejava.lang.IllegalArgumentException
- If the any of the specified Permissions is null
@CheckReturnValue public PermissionOverrideAction setAllow(Permission... permissions)
Permissions
.
isChannel()
will have no affect!permissions
- The Permissions representing the granted
permissions for the new PermissionOverride.
null
the permissions are reset to the default of nonejava.lang.IllegalArgumentException
- If the any of the specified Permissions is null
@CheckReturnValue public PermissionOverrideAction setDeny(long denyBits)
Permissions
.
Permissions.getRaw(Permission...)
!
isChannel()
will have no affect!denyBits
- The positive bits representing the denied
permissions for the new PermissionOverridejava.lang.IllegalArgumentException
- If the provided bits are negative
or higher than Permission.ALL_PERMISSIONS
@CheckReturnValue public PermissionOverrideAction setDeny(java.util.Collection<Permission> permissions)
Permissions
.
isChannel()
will have no affect!permissions
- The Collection of Permissions representing the denied
permissions for the new PermissionOverride.
null
the permissions are reset to the default of nonejava.lang.IllegalArgumentException
- If the any of the specified Permissions is null
@CheckReturnValue public PermissionOverrideAction setDeny(Permission... permissions)
Permissions
.
isChannel()
will have no affect!permissions
- The Permissions representing the denied
permissions for the new PermissionOverride.
null
the permissions are reset to the default of nonejava.lang.IllegalArgumentException
- If the any of the specified Permissions is null
@CheckReturnValue public PermissionOverrideAction setPermissions(long allowBits, long denyBits)
setAllow(long)
and setDeny(long)
allowBits
- A non-negative bitwise representation
of granted PermissionsdenyBits
- A non-negative bitwise representation
of denied Permissionsjava.lang.IllegalArgumentException
- If any of the provided bits are negative
or higher than Permission.ALL_PERMISSIONS
@CheckReturnValue public PermissionOverrideAction setPermissions(java.util.Collection<Permission> grantPermissions, java.util.Collection<Permission> denyPermissions)
setAllow(java.util.Collection)
and setDeny(java.util.Collection)
null
it resets the represented value to 0
- no permission specifics.grantPermissions
- A Collection of Permissions
representing all explicitly granted Permissions for the PermissionOverridedenyPermissions
- A Collection of Permissions
representing all explicitly denied Permissions for the PermissionOverridejava.lang.IllegalArgumentException
- If the any of the specified Permissions is null