Class Activity.Emoji

  • All Implemented Interfaces:
    java.util.Formattable, IMentionable, ISnowflake
    Enclosing interface:
    Activity

    public static class Activity.Emoji
    extends java.lang.Object
    implements ISnowflake, IMentionable
    Emoji for a custom status.
    This can be a unicode emoji or a custom emoji (Emote).
    • Constructor Summary

      Constructors 
      Constructor Description
      Emoji​(java.lang.String name)  
      Emoji​(java.lang.String name, long id, boolean animated)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      java.lang.String getAsCodepoints()
      The codepoint notation ("U+XXXX") for the unicode of this emoji.
      java.lang.String getAsMention()
      Retrieve a Mention for this Entity.
      long getIdLong()
      The id for this custom emoji.
      java.lang.String getName()
      The name of this emoji.
      int hashCode()  
      boolean isAnimated()
      Whether this emoji is animated.
      boolean isEmoji()
      Whether this is a unicode emoji.
      boolean isEmote()
      Whether this is a custom emoji (Emote)
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • Emoji

        public Emoji​(java.lang.String name,
                     long id,
                     boolean animated)
      • Emoji

        public Emoji​(java.lang.String name)
    • Method Detail

      • getName

        @Nonnull
        public java.lang.String getName()
        The name of this emoji. This will be the unicode characters for a unicode emoji and the name of the custom emote otherwise.
        Returns:
        The emoji name
        See Also:
        getAsCodepoints()
      • getAsCodepoints

        @Nonnull
        public java.lang.String getAsCodepoints()
        The codepoint notation ("U+XXXX") for the unicode of this emoji. Not available for custom emotes.
        Returns:
        The codepoint notation
        Throws:
        java.lang.IllegalStateException - If isEmoji() is false
        See Also:
        getName()
      • getIdLong

        public long getIdLong()
        The id for this custom emoji.
        Specified by:
        getIdLong in interface ISnowflake
        Returns:
        The emoji id
        Throws:
        java.lang.IllegalStateException - If isEmote() is false
      • isAnimated

        public boolean isAnimated()
        Whether this emoji is animated. This is always false for unicode emoji.
        Returns:
        True, if this emoji is animated
      • isEmoji

        public boolean isEmoji()
        Whether this is a unicode emoji.
        Returns:
        True, if this is a unicode emoji
      • isEmote

        public boolean isEmote()
        Whether this is a custom emoji (Emote)
        Returns:
        True, if this is a custom emoji
      • getAsMention

        @Nonnull
        public java.lang.String getAsMention()
        Description copied from interface: IMentionable
        Retrieve a Mention for this Entity. For the public Role (@everyone), this will return the literal string "@everyone".
        Specified by:
        getAsMention in interface IMentionable
        Returns:
        A resolvable mention.
      • hashCode

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

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object