public class RoleManager
extends java.lang.Object
RoleManagerUpdatable instance.
This decoration allows to modify a single field by automatically building an update RestAction
| Constructor and Description |
|---|
RoleManager(Role role)
Creates a new RoleManager instance
|
| Modifier and Type | Method and Description |
|---|---|
Guild |
getGuild()
|
JDA |
getJDA()
The
JDA instance of this Manager |
Role |
getRole()
The target
Role for this
manager |
AuditableRestAction<java.lang.Void> |
givePermissions(java.util.Collection<Permission> perms)
Adds the specified
Permissions to the selected Role. |
AuditableRestAction<java.lang.Void> |
givePermissions(Permission... perms)
Adds the specified
Permissions to the selected Role. |
AuditableRestAction<java.lang.Void> |
revokePermissions(java.util.Collection<Permission> perms)
Revokes the specified
Permissions from the selected Role. |
AuditableRestAction<java.lang.Void> |
revokePermissions(Permission... perms)
Revokes the specified
Permissions from the selected Role. |
AuditableRestAction<java.lang.Void> |
setColor(java.awt.Color color)
Sets the
Color of the selected Role. |
AuditableRestAction<java.lang.Void> |
setHoisted(boolean hoisted)
Sets the hoist state of the selected
Role. |
AuditableRestAction<java.lang.Void> |
setMentionable(boolean mentionable)
Sets the mentionable state of the selected
Role. |
AuditableRestAction<java.lang.Void> |
setName(java.lang.String name)
Sets the name of the selected
Role. |
AuditableRestAction<java.lang.Void> |
setPermissions(java.util.Collection<Permission> permissions)
Sets the
Permissions of the selected Role. |
AuditableRestAction<java.lang.Void> |
setPermissions(long perms)
Sets the
Permissions of the selected Role. |
AuditableRestAction<java.lang.Void> |
setPermissions(Permission... permissions)
Sets the
Permissions of the selected Role. |
@CheckReturnValue public AuditableRestAction<java.lang.Void> setName(java.lang.String name)
Role.
RoleManagerUpdatable.getNameField()
A role name must not be null nor less than 1 characters or more than 32 characters long!
name - The new name for the selected RoleAuditableRestAction
#update()InsufficientPermissionException - If the currently logged in account does not have the Permission MANAGE_ROLESHierarchyException - If the currently logged in account does not meet the required hierarchy position
to interact with this Rolejava.lang.IllegalArgumentException - If the provided name is null or not between 1-32 characters longRoleManagerUpdatable.getNameField(),
RoleManagerUpdatable.update()@CheckReturnValue public AuditableRestAction<java.lang.Void> setPermissions(long perms)
Permissions of the selected Role.
RoleManagerUpdatable#getPermissionField().setValue(Long)
Permissions may only include already present Permissions for the currently logged in account.
You are unable to give permissions you don't have!
perms - The new raw permission value for the selected RoleAuditableRestAction
#update()InsufficientPermissionException - If the currently logged in account does not have the Permission MANAGE_ROLES
HierarchyException - If the currently logged in account does not meet the required hierarchy position
to interact with this RoleRoleManagerUpdatable.getPermissionField(),
RoleManagerUpdatable.update(),
setPermissions(Collection),
setPermissions(Permission...)@CheckReturnValue public AuditableRestAction<java.lang.Void> setPermissions(Permission... permissions)
Permissions of the selected Role.
RoleManagerUpdatable#getPermissionField().setPermissions(Permission...)
Permissions may only include already present Permissions for the currently logged in account.
You are unable to give permissions you don't have!
permissions - The new permission for the selected RoleAuditableRestAction
#update()InsufficientPermissionException - If the currently logged in account does not have the Permission MANAGE_ROLES
HierarchyException - If the currently logged in account does not meet the required hierarchy position
to interact with this Rolejava.lang.IllegalArgumentException - If any of the provided values is nullRoleManagerUpdatable.getPermissionField(),
RoleManagerUpdatable.update(),
setPermissions(Collection),
setPermissions(long)@CheckReturnValue public AuditableRestAction<java.lang.Void> setPermissions(java.util.Collection<Permission> permissions)
Permissions of the selected Role.
RoleManagerUpdatable#getPermissionField().setPermissions(Collection)
Permissions may only include already present Permissions for the currently logged in account.
You are unable to give permissions you don't have!
permissions - The new permission for the selected RoleAuditableRestAction
#update()InsufficientPermissionException - If the currently logged in account does not have the Permission MANAGE_ROLES
HierarchyException - If the currently logged in account does not meet the required hierarchy position
to interact with this Rolejava.lang.IllegalArgumentException - If any of the provided values is nullRoleManagerUpdatable.getPermissionField(),
RoleManagerUpdatable.update(),
setPermissions(Permission...),
setPermissions(long)@CheckReturnValue public AuditableRestAction<java.lang.Void> setColor(java.awt.Color color)
color - The new color for the selected RoleAuditableRestAction
#update()InsufficientPermissionException - If the currently logged in account does not have the Permission MANAGE_ROLESHierarchyException - If the currently logged in account does not meet the required hierarchy position
to interact with this RoleRoleManagerUpdatable.getColorField(),
RoleManagerUpdatable.update()@CheckReturnValue public AuditableRestAction<java.lang.Void> setHoisted(boolean hoisted)
hoisted - Whether the selected Role should be hoistedAuditableRestAction
#update()InsufficientPermissionException - If the currently logged in account does not have the Permission MANAGE_ROLESHierarchyException - If the currently logged in account does not meet the required hierarchy position
to interact with this RoleRoleManagerUpdatable.getHoistedField(),
RoleManagerUpdatable.update()@CheckReturnValue public AuditableRestAction<java.lang.Void> setMentionable(boolean mentionable)
mentionable - Whether the selected Role should be mentionableAuditableRestAction
#update()InsufficientPermissionException - If the currently logged in account does not have the Permission MANAGE_ROLESHierarchyException - If the currently logged in account does not meet the required hierarchy position
to interact with this RoleRoleManagerUpdatable.getMentionableField(),
RoleManagerUpdatable.update()@CheckReturnValue public AuditableRestAction<java.lang.Void> givePermissions(Permission... perms)
Permissions to the selected Role.
RoleManagerUpdatable#getPermissionField().givePermissions(Permission...)
Permissions may only include already present Permissions for the currently logged in account.
You are unable to give permissions you don't have!
perms - The permission to give to the selected RoleAuditableRestAction
#update()InsufficientPermissionException - If the currently logged in account does not have the Permission MANAGE_ROLES
HierarchyException - If the currently logged in account does not meet the required hierarchy position
to interact with this RoleRoleManagerUpdatable.getPermissionField(),
RoleManagerUpdatable.update(),
setPermissions(Collection),
setPermissions(Permission...)@CheckReturnValue public AuditableRestAction<java.lang.Void> givePermissions(java.util.Collection<Permission> perms)
Permissions to the selected Role.
RoleManagerUpdatable#getPermissionField().givePermissions(Collection)
Permissions may only include already present Permissions for the currently logged in account.
You are unable to give permissions you don't have!
perms - The permission to give to the selected RoleAuditableRestAction
#update()InsufficientPermissionException - If the currently logged in account does not have the Permission MANAGE_ROLES
HierarchyException - If the currently logged in account does not meet the required hierarchy position
to interact with this RoleRoleManagerUpdatable.getPermissionField(),
RoleManagerUpdatable.update(),
setPermissions(Collection),
setPermissions(Permission...)@CheckReturnValue public AuditableRestAction<java.lang.Void> revokePermissions(Permission... perms)
Permissions from the selected Role.
RoleManagerUpdatable#getPermissionField().revokePermissions(Permission...)
Permissions may only include already present Permissions for the currently logged in account.
You are unable to revoke permissions you don't have!
perms - The permission to give to the selected RoleAuditableRestAction
#update()InsufficientPermissionException - If the currently logged in account does not have the Permission MANAGE_ROLES
HierarchyException - If the currently logged in account does not meet the required hierarchy position
to interact with this RoleRoleManagerUpdatable.getPermissionField(),
RoleManagerUpdatable.update(),
setPermissions(Collection),
setPermissions(Permission...)@CheckReturnValue public AuditableRestAction<java.lang.Void> revokePermissions(java.util.Collection<Permission> perms)
Permissions from the selected Role.
RoleManagerUpdatable#getPermissionField().revokePermissions(Collection)
Permissions may only include already present Permissions for the currently logged in account.
You are unable to revoke permissions you don't have!
perms - The permission to give to the selected RoleAuditableRestAction
#update()InsufficientPermissionException - If the currently logged in account does not have the Permission MANAGE_ROLES
HierarchyException - If the currently logged in account does not meet the required hierarchy position
to interact with this RoleRoleManagerUpdatable.getPermissionField(),
RoleManagerUpdatable.update(),
setPermissions(Collection),
setPermissions(Permission...)