Class TemplateRole
java.lang.Object
net.dv8tion.jda.api.entities.templates.TemplateRole
- All Implemented Interfaces:
ISnowflake
POJO for the roles information provided by a template.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTemplateRole(long id, String name, int color, boolean hoisted, boolean mentionable, long rawPermissions) -
Method Summary
Modifier and TypeMethodDescriptiongetColor()The color thisRoleis displayed in.intThe raw color RGB value used for this role
Defaults toRole.DEFAULT_COLOR_RAWif this role has no set colorlongThe ids of roles are their position as stored by Discord so this will not look like a typical snowflake.getName()The Name of thisRole.The Guild-Wide Permissions this PermissionHolder holds.longThelongrepresentation of the literal permissions that thisRolehas.As the ids of roles are their position, the date of creation cannot be calculated.booleanWhether thisRoleis hoisted
Members in a hoisted role are displayed in their own grouping on the user-listbooleanWhether or not this Role is mentionableMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId
-
Constructor Details
-
TemplateRole
public TemplateRole(long id, String name, int color, boolean hoisted, boolean mentionable, long rawPermissions)
-
-
Method Details
-
getIdLong
public long getIdLong()The ids of roles are their position as stored by Discord so this will not look like a typical snowflake.- Specified by:
getIdLongin interfaceISnowflake- Returns:
- The id of the role as stored by Discord
-
getTimeCreated
As the ids of roles are their position, the date of creation cannot be calculated.- Specified by:
getTimeCreatedin interfaceISnowflake- Returns:
- OffsetDateTime - Time this entity was created at.
- Throws:
UnsupportedOperationException- The date of creation cannot be calculated.- See Also:
-
getName
The Name of thisRole.- Returns:
- Never-null String containing the name of this
Role.
-
getColor
The color thisRoleis displayed in.- Returns:
- Color value of Role-color
- See Also:
-
getColorRaw
public int getColorRaw()The raw color RGB value used for this role
Defaults toRole.DEFAULT_COLOR_RAWif this role has no set color- Returns:
- The raw RGB color value or default
-
isHoisted
public boolean isHoisted()Whether thisRoleis hoisted
Members in a hoisted role are displayed in their own grouping on the user-list- Returns:
- True, if this
Roleis hoisted.
-
isMentionable
public boolean isMentionable()Whether or not this Role is mentionable- Returns:
- True, if Role is mentionable.
-
getPermissions
The Guild-Wide Permissions this PermissionHolder holds.
Changes to the returned set do not affect this entity directly.- Returns:
- An EnumSet of Permissions granted to this PermissionHolder.
-
getPermissionsRaw
public long getPermissionsRaw()Thelongrepresentation of the literal permissions that thisRolehas.- Returns:
- Never-negative long containing offset permissions of this role.
-