Class RoleIcon


  • public class RoleIcon
    extends java.lang.Object
    An object representing a Role's icon.
    See Also:
    Role.getIcon()
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ICON_URL
      Template for getIconUrl().
    • Constructor Summary

      Constructors 
      Constructor Description
      RoleIcon​(java.lang.String iconId, java.lang.String emoji, long roleId)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      java.lang.String getEmoji()
      The Unicode Emoji of this Role that is used instead of a custom image.
      java.lang.String getIconId()
      The Discord hash-id of the Role icon image.
      java.lang.String getIconUrl()
      The URL of the Role icon image.
      int hashCode()  
      boolean isEmoji()
      Whether this RoleIcon is an emoji instead of a custom image.
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RoleIcon

        public RoleIcon​(java.lang.String iconId,
                        java.lang.String emoji,
                        long roleId)
    • Method Detail

      • getIconId

        @Nullable
        public java.lang.String getIconId()
        The Discord hash-id of the Role icon image. If no icon has been set or an emoji is used in its place, this returns null.

        The Role icon can be modified using RoleManager.setIcon(Icon).

        Returns:
        Possibly-null String containing the Role's icon hash-id.
        Since:
        4.3.1
      • getIconUrl

        @Nullable
        public java.lang.String getIconUrl()
        The URL of the Role icon image. If no icon has been set or an emoji is used in its place, this returns null.

        The Role icon can be modified using RoleManager.setIcon(Icon).

        Returns:
        Possibly-null String containing the Role's icon URL.
        Since:
        4.3.1
      • getEmoji

        @Nullable
        public java.lang.String getEmoji()
        The Unicode Emoji of this Role that is used instead of a custom image. If no emoji has been set, this returns null.

        The Role emoji can be modified using RoleManager.setIcon(String).

        Returns:
        Possibly-null String containing the Role's Unicode Emoji.
        Since:
        4.3.1
      • isEmoji

        public boolean isEmoji()
        Whether this RoleIcon is an emoji instead of a custom image.
        Returns:
        True, if this RoleIcon is an emoji
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object