Class GuildAction.RoleData
- java.lang.Object
-
- net.dv8tion.jda.api.requests.restaction.GuildAction.RoleData
-
- All Implemented Interfaces:
SerializableData
- Enclosing interface:
- GuildAction
public static class GuildAction.RoleData extends Object implements SerializableData
Mutable object containing information on aRoleof the resultingGuildthat is constructed by a GuildAction instanceThis may be used in
GuildAction.ChannelData.addPermissionOverride(RoleData, long, long)ChannelData.addPermissionOverride(...)}!
-
-
Constructor Summary
Constructors Constructor Description RoleData(long id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GuildAction.RoleDataaddPermissions(Collection<Permission> permissions)Adds the provided permissions to the RoleGuildAction.RoleDataaddPermissions(Permission... permissions)Adds the provided permissions to the RoleGuildAction.RoleDatasetColor(Color color)Sets the color for this RoleGuildAction.RoleDatasetColor(Integer color)Sets the color for this RoleGuildAction.RoleDatasetHoisted(Boolean hoisted)Sets whether the Role is hoistedGuildAction.RoleDatasetMentionable(Boolean mentionable)Sets whether the Role is mentionableGuildAction.RoleDatasetName(String name)Sets the name for this RoleGuildAction.RoleDatasetPermissionsRaw(Long rawPermissions)Sets the raw permission value for this RoleGuildAction.RoleDatasetPosition(Integer position)Sets the position for this RoleDataObjecttoData()SerializedDataObjectfor this object.
-
-
-
Method Detail
-
setPermissionsRaw
@Nonnull public GuildAction.RoleData setPermissionsRaw(@Nullable Long rawPermissions)
Sets the raw permission value for this Role- Parameters:
rawPermissions- Raw permission value- Returns:
- The current RoleData instance for chaining convenience
- Throws:
IllegalArgumentException- If the provided permissions are negative or exceed the maximum permissions
-
addPermissions
@Nonnull public GuildAction.RoleData addPermissions(@Nonnull Permission... permissions)
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
@Nonnull public GuildAction.RoleData addPermissions(@Nonnull 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:
IllegalArgumentException- If any of the provided permissions isnull
-
setName
@Nonnull public GuildAction.RoleData setName(@Nullable String name)
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
@Nonnull public GuildAction.RoleData setColor(@Nullable Color color)
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
@Nonnull public GuildAction.RoleData setColor(@Nullable Integer color)
Sets the color for this Role- Parameters:
color- The color for this Role, ornullto unset- Returns:
- The current RoleData instance for chaining convenience
- Throws:
IllegalStateException- If this is the public role
-
setPosition
@Nonnull public GuildAction.RoleData setPosition(@Nullable Integer position)
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
@Nonnull public GuildAction.RoleData setMentionable(@Nullable Boolean mentionable)
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
@Nonnull public GuildAction.RoleData setHoisted(@Nullable Boolean hoisted)
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
@Nonnull public DataObject toData()
Description copied from interface:SerializableDataSerializedDataObjectfor this object.- Specified by:
toDatain interfaceSerializableData- Returns:
DataObject
-
-