Class GuildAction.RoleData
- java.lang.Object
-
- net.dv8tion.jda.core.requests.restaction.GuildAction.RoleData
-
- All Implemented Interfaces:
org.json.JSONString
- Enclosing class:
- GuildAction
public static class GuildAction.RoleData extends java.lang.Object implements org.json.JSONString
Mutable object containing information on aRole
of the resultingGuild
that is constructed by a GuildAction instanceThis may be used in
GuildAction.ChannelData.addPermissionOverride(GuildAction.RoleData, long, long)
ChannelData.addPermissionOverride(...)}!
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GuildAction.RoleData
addPermissions(java.util.Collection<Permission> permissions)
Adds the provided permissions to the RoleGuildAction.RoleData
addPermissions(Permission... permissions)
Adds the provided permissions to the RoleGuildAction.RoleData
setColor(java.awt.Color color)
Sets the color for this RoleGuildAction.RoleData
setColor(java.lang.Integer color)
Sets the color for this RoleGuildAction.RoleData
setHoisted(java.lang.Boolean hoisted)
Sets whether the Role is hoistedGuildAction.RoleData
setMentionable(java.lang.Boolean mentionable)
Sets whether the Role is mentionableGuildAction.RoleData
setName(java.lang.String name)
Sets the name for this RoleGuildAction.RoleData
setPermissionsRaw(java.lang.Long rawPermissions)
Sets the raw permission value for this RoleGuildAction.RoleData
setPosition(java.lang.Integer position)
Sets the position for this Rolejava.lang.String
toJSONString()
-
-
-
Method Detail
-
setPermissionsRaw
public GuildAction.RoleData setPermissionsRaw(java.lang.Long rawPermissions)
Sets the raw permission value for this Role- Parameters:
rawPermissions
- Raw permission value- Returns:
- The current RoleData instance for chaining convenience
- Throws:
java.lang.IllegalArgumentException
- If the provided permissions are negative or exceed the maximum permissions
-
addPermissions
public GuildAction.RoleData addPermissions(Permission... permissions)
Adds the provided permissions to the Role- Parameters:
permissions
- The permissions to add- Returns:
- The current RoleData instance for chaining convenience
- Throws:
java.lang.IllegalArgumentException
- If any of the provided permissions isnull
-
addPermissions
public GuildAction.RoleData addPermissions(java.util.Collection<Permission> permissions)
Adds the provided permissions to the Role- Parameters:
permissions
- The permissions to add- Returns:
- The current RoleData instance for chaining convenience
- Throws:
java.lang.IllegalArgumentException
- If any of the provided permissions isnull
-
setName
public GuildAction.RoleData setName(java.lang.String name)
Sets the name for this Role- Parameters:
name
- The name- Returns:
- The current RoleData instance for chaining convenience
- Throws:
java.lang.IllegalStateException
- If this is the public role
-
setColor
public GuildAction.RoleData setColor(java.awt.Color color)
Sets the color for this Role- Parameters:
color
- The color for this Role- Returns:
- The current RoleData instance for chaining convenience
- Throws:
java.lang.IllegalStateException
- If this is the public role
-
setColor
public GuildAction.RoleData setColor(java.lang.Integer color)
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:
java.lang.IllegalStateException
- If this is the public role
-
setPosition
public GuildAction.RoleData setPosition(java.lang.Integer position)
Sets the position for this Role- Parameters:
position
- The position- Returns:
- The current RoleData instance for chaining convenience
- Throws:
java.lang.IllegalStateException
- If this is the public role
-
setMentionable
public GuildAction.RoleData setMentionable(java.lang.Boolean mentionable)
Sets whether the Role is mentionable- Parameters:
mentionable
- Whether the role is mentionable- Returns:
- The current RoleData instance for chaining convenience
- Throws:
java.lang.IllegalStateException
- If this is the public role
-
setHoisted
public GuildAction.RoleData setHoisted(java.lang.Boolean hoisted)
Sets whether the Role is hoisted- Parameters:
hoisted
- Whether the role is hoisted- Returns:
- The current RoleData instance for chaining convenience
- Throws:
java.lang.IllegalStateException
- If this is the public role
-
toJSONString
public java.lang.String toJSONString()
- Specified by:
toJSONString
in interfaceorg.json.JSONString
-
-