Class RoleImpl
java.lang.Object
com.mewna.catnip.entity.impl.guild.RoleImpl
- All Implemented Interfaces:
Entity
,Role
,GuildEntity
,HasGuild
,HasName
,Mentionable
,Permissable
,Snowflake
,Timestamped
,RequiresCatnip
,Comparable<Role>
- Since:
- 9/2/18
- Author:
- Julia Rogers
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.mewna.catnip.entity.partials.Timestamped
Timestamped.TimestampStyle
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic RoleImpl.RoleImplBuilder
builder()
catnip()
Returns the catnip instance associated with this entity.void
int
color()
Integer representation of the role color.color
(int color) boolean
long
The id of the guild this entity is from.guildIdAsLong
(long guildIdAsLong) int
hashCode()
boolean
hoist()
Whether or not the role "hoists" users with it into a group in the user list.hoist
(boolean hoist) icon()
This role's icon hash.long
idAsLong()
The ID of this snowflake, as a long.idAsLong
(long idAsLong) boolean
managed()
Whether or not this role is managed by a 3rd party connection.managed
(boolean managed) boolean
Whether or not mentioning this role will effectively mention those with it.mentionable
(boolean mentionable) name()
long
Permissions this role grants users in the guild.permissionsRaw
(long permissionsRaw) int
position()
Position of the role within the guild it's from.position
(int position) tags()
The tags for this role.toString()
unicodeEmoji
(String unicodeEmoji) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.mewna.catnip.entity.partials.GuildEntity
guild
Methods inherited from interface com.mewna.catnip.entity.partials.Permissable
hasPermissions, hasPermissions
Methods inherited from interface com.mewna.catnip.entity.guild.Role
asMention, canInteract, canInteract, compareTo, hasPermissions, hasPermissions, permissions
Methods inherited from interface com.mewna.catnip.entity.partials.Snowflake
creationTime, creationTimestamp, id
Methods inherited from interface com.mewna.catnip.entity.partials.Timestamped
asDiscordTimestamp, parseTimestamp
-
Constructor Details
-
RoleImpl
public RoleImpl() -
RoleImpl
-
-
Method Details
-
catnip
- Specified by:
catnip
in interfaceRequiresCatnip
-
hashCode
public int hashCode() -
equals
-
toString
-
builder
-
catnip
Description copied from interface:Entity
Returns the catnip instance associated with this entity. -
idAsLong
public long idAsLong()Description copied from interface:Snowflake
The ID of this snowflake, as a long. -
guildIdAsLong
public long guildIdAsLong()Description copied from interface:HasGuild
The id of the guild this entity is from.- Specified by:
guildIdAsLong
in interfaceHasGuild
- Returns:
- Long representing the guild ID.
-
name
-
color
public int color()Description copied from interface:Role
Integer representation of the role color.
To use this, you must convert the integer to base-16, hex, format. The default role color is0
. -
hoist
public boolean hoist()Description copied from interface:Role
Whether or not the role "hoists" users with it into a group in the user list. -
position
public int position()Description copied from interface:Role
Position of the role within the guild it's from.Note: Raw positions fetched from Discord are a bit weird and may confuse you sometimes.
-
permissionsRaw
public long permissionsRaw()Description copied from interface:Role
Permissions this role grants users in the guild.
Channels may override and add to or remove from this.- Specified by:
permissionsRaw
in interfacePermissable
- Specified by:
permissionsRaw
in interfaceRole
- Returns:
- Bit set of permissions granted by this role.
-
managed
public boolean managed()Description copied from interface:Role
Whether or not this role is managed by a 3rd party connection.
Most often, this is seen on bots which were added using a permission parameter in their invite link.
If true, this role cannot be modified by users through normal means. -
mentionable
public boolean mentionable()Description copied from interface:Role
Whether or not mentioning this role will effectively mention those with it.
Roles can always be mentioned, but will not mention users with it unless this is true.- Specified by:
mentionable
in interfaceRole
- Returns:
- True if the role is mentionable, false otherwise.
-
tags
Description copied from interface:Role
The tags for this role. Role tags are things like:- Whether or not this is the Nitro boost role.
- Whether or not this is a bot-specific role.
- Whether or not this is an integration-specific role.
-
icon
Description copied from interface:Role
This role's icon hash. Use withCDNFormat.roleIconUrl(String, String, ImageOptions)
. This property is only non-nullable if the guild has theGuildFeature.ROLE_ICONS
feature. -
unicodeEmoji
- Specified by:
unicodeEmoji
in interfaceRole
- See Also:
-
idAsLong
- Returns:
this
.
-
guildIdAsLong
- Returns:
this
.
-
name
- Returns:
this
.
-
color
- Returns:
this
.
-
hoist
- Returns:
this
.
-
position
- Returns:
this
.
-
permissionsRaw
- Returns:
this
.
-
managed
- Returns:
this
.
-
mentionable
- Returns:
this
.
-
tags
- Returns:
this
.
-
icon
- Returns:
this
.
-
unicodeEmoji
- Returns:
this
.
-