Class GuildAction.RoleData
java.lang.Object
net.dv8tion.jda.api.requests.restaction.GuildAction.RoleData
- All Implemented Interfaces:
SerializableData
- Enclosing interface:
- GuildAction
Mutable object containing information on a
Role
of the resulting Guild
that is constructed by a GuildAction instance
This may be used in GuildAction.ChannelData.addPermissionOverride(GuildAction.RoleData, long, long)
ChannelData.addPermissionOverride(...)}!
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddPermissions
(Collection<Permission> permissions) Adds the provided permissions to the RoleaddPermissions
(Permission... permissions) Adds the provided permissions to the RoleSets the color for this RoleSets the color for this RolesetHoisted
(Boolean hoisted) Sets whether the Role is hoistedsetMentionable
(Boolean mentionable) Sets whether the Role is mentionableSets the name for this RolesetPermissionsRaw
(Long rawPermissions) Sets the raw permission value for this RolesetPosition
(Integer position) Sets the position for this RoletoData()
SerializedDataObject
for this object.
-
Constructor Details
-
RoleData
public RoleData(long id)
-
-
Method Details
-
setPermissionsRaw
Sets the raw permission value for this Role- Parameters:
rawPermissions
- Raw permission value- Returns:
- The current RoleData instance for chaining convenience
-
addPermissions
Adds the provided permissions to the Role- Parameters:
permissions
- The permissions to add- Returns:
- The current RoleData instance for chaining convenience
- Throws:
IllegalArgumentException
- If any of the provided permissions isnull
-
addPermissions
Adds the provided permissions to the Role- Parameters:
permissions
- The permissions to add- Returns:
- The current RoleData instance for chaining convenience
- Throws:
IllegalArgumentException
- If any of the provided permissions isnull
-
setName
Sets the name for this Role- Parameters:
name
- The name- Returns:
- The current RoleData instance for chaining convenience
- Throws:
IllegalStateException
- If this is the public role
-
setColor
Sets the color for this Role- Parameters:
color
- The color for this Role- Returns:
- The current RoleData instance for chaining convenience
- Throws:
IllegalStateException
- If this is the public role
-
setColor
Sets the color for this Role- Parameters:
color
- The color for this Role, ornull
to unset- Returns:
- The current RoleData instance for chaining convenience
- Throws:
IllegalStateException
- If this is the public role
-
setPosition
Sets the position for this Role- Parameters:
position
- The position- Returns:
- The current RoleData instance for chaining convenience
- Throws:
IllegalStateException
- If this is the public role
-
setMentionable
Sets whether the Role is mentionable- Parameters:
mentionable
- Whether the role is mentionable- Returns:
- The current RoleData instance for chaining convenience
- Throws:
IllegalStateException
- If this is the public role
-
setHoisted
Sets whether the Role is hoisted- Parameters:
hoisted
- Whether the role is hoisted- Returns:
- The current RoleData instance for chaining convenience
- Throws:
IllegalStateException
- If this is the public role
-
toData
Description copied from interface:SerializableData
SerializedDataObject
for this object.- Specified by:
toData
in interfaceSerializableData
- Returns:
DataObject
-