Class TemplateRole

    • Constructor Summary

      Constructors 
      Constructor Description
      TemplateRole​(long id, java.lang.String name, int color, boolean hoisted, boolean mentionable, long rawPermissions)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.awt.Color getColor()
      The color this Role is displayed in.
      int getColorRaw()
      The raw color RGB value used for this role
      Defaults to Role.DEFAULT_COLOR_RAW if this role has no set color
      long getIdLong()
      The ids of roles are their position as stored by Discord so this will not look like a typical snowflake.
      java.lang.String getName()
      The Name of this Role.
      java.util.EnumSet<Permission> getPermissions()
      The Guild-Wide Permissions this PermissionHolder holds.
      long getPermissionsRaw()
      The long representation of the literal permissions that this Role has.
      java.time.OffsetDateTime getTimeCreated()
      As the ids of roles are their position, the date of creation cannot be calculated.
      boolean isHoisted()
      Whether this Role is hoisted
      Members in a hoisted role are displayed in their own grouping on the user-list
      boolean isMentionable()
      Whether or not this Role is mentionable
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake

        getId
    • Constructor Detail

      • TemplateRole

        public TemplateRole​(long id,
                            java.lang.String name,
                            int color,
                            boolean hoisted,
                            boolean mentionable,
                            long rawPermissions)
    • Method Detail

      • 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:
        getIdLong in interface ISnowflake
        Returns:
        The id of the role as stored by Discord
      • getTimeCreated

        public java.time.OffsetDateTime getTimeCreated()
        As the ids of roles are their position, the date of creation cannot be calculated.
        Specified by:
        getTimeCreated in interface ISnowflake
        Returns:
        OffsetDateTime - Time this entity was created at.
        Throws:
        java.lang.UnsupportedOperationException - The date of creation cannot be calculated.
        See Also:
        TimeUtil.getTimeCreated(long)
      • getName

        @Nonnull
        public java.lang.String getName()
        The Name of this Role.
        Returns:
        Never-null String containing the name of this Role.
      • getColor

        @Nullable
        public java.awt.Color getColor()
        The color this Role is displayed in.
        Returns:
        Color value of Role-color
        See Also:
        getColorRaw()
      • getColorRaw

        public int getColorRaw()
        The raw color RGB value used for this role
        Defaults to Role.DEFAULT_COLOR_RAW if this role has no set color
        Returns:
        The raw RGB color value or default
      • isHoisted

        public boolean isHoisted()
        Whether this Role is hoisted
        Members in a hoisted role are displayed in their own grouping on the user-list
        Returns:
        True, if this Role is hoisted.
      • isMentionable

        public boolean isMentionable()
        Whether or not this Role is mentionable
        Returns:
        True, if Role is mentionable.
      • getPermissions

        @Nonnull
        public java.util.EnumSet<Permission> 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()
        The long representation of the literal permissions that this Role has.
        Returns:
        Never-negative long containing offset permissions of this role.