public class PermissionOverrideAction extends RestAction<PermissionOverride>
RestAction
specifically
designed to create a PermissionOverride
for a Channel
.
This extension allows setting properties before executing the action.RestAction.EmptyRestAction<T>
DEFAULT_FAILURE, DEFAULT_SUCCESS, LOG
Constructor and Description |
---|
PermissionOverrideAction(JDA api,
Route.CompiledRoute route,
Channel channel,
Member member)
Creates a new PermissionOverrideAction instance
|
PermissionOverrideAction(JDA api,
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) |
public PermissionOverrideAction(JDA api, Route.CompiledRoute route, Channel channel, Member member)
api
- The current JDA instanceroute
- The Route.CompiledRoute
to be used for rate limit handlingchannel
- The target Channel
for the PermissionOverridemember
- The target Member
that will be affected by the PermissionOverridepublic PermissionOverrideAction(JDA api, Route.CompiledRoute route, Channel channel, Role role)
api
- The current JDA instanceroute
- The Route.CompiledRoute
to be used for rate limit handlingchannel
- The target Channel
for the PermissionOverriderole
- The target Role
that will be affected by the PermissionOverridepublic 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()
)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
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
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
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
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
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
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
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