Class CustomEmojiImpl

java.lang.Object
com.mewna.catnip.entity.impl.misc.CustomEmojiImpl
All Implemented Interfaces:
Entity, Emoji, Emoji.CustomEmoji, GuildEntity, HasGuild, HasNullableName, Snowflake, Timestamped, RequiresCatnip

public class CustomEmojiImpl extends Object implements Emoji.CustomEmoji, RequiresCatnip
Since:
9/5/18.
Author:
natanbc
  • Constructor Details

    • CustomEmojiImpl

      public CustomEmojiImpl()
    • CustomEmojiImpl

      public CustomEmojiImpl(Catnip catnip, long idAsLong, long guildIdAsLong, String name, List<String> roles, User user, boolean requiresColons, boolean managed, boolean animated)
  • Method Details

    • catnip

      public void catnip(@Nonnull Catnip catnip)
      Specified by:
      catnip in interface RequiresCatnip
    • hashCode

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • builder

      public static CustomEmojiImpl.CustomEmojiImplBuilder builder()
    • catnip

      public Catnip catnip()
      Description copied from interface: Entity
      Returns the catnip instance associated with this entity.
      Specified by:
      catnip in interface Entity
      Returns:
      The catnip instance of this entity.
    • idAsLong

      public long idAsLong()
      Description copied from interface: Snowflake
      The ID of this snowflake, as a long.
      Specified by:
      idAsLong in interface Snowflake
      Returns:
      Long representing the ID.
    • guildIdAsLong

      public long guildIdAsLong()
      Description copied from interface: Emoji.CustomEmoji
      ID of guild that owns this emoji, or 0 if it has no guild.

      NOTE: This may be null in the case of a reaction, because the data may not be available to get the id for the emoji!

      Specified by:
      guildIdAsLong in interface Emoji.CustomEmoji
      Specified by:
      guildIdAsLong in interface HasGuild
      Returns:
      Long representing the ID.
    • name

      public String name()
      Description copied from interface: Emoji
      Name of this emoji, if it's custom, or it's unicode value.
      This may be null in the case of reactions.
      Specified by:
      name in interface Emoji
      Specified by:
      name in interface HasNullableName
      Returns:
      String representing the name or unicode value.
    • roles

      public List<String> roles()
      Description copied from interface: Emoji
      Roles that are allowed to use this emoji. If empty, all users can use it.
      Always empty for unicode emoji.
      Specified by:
      roles in interface Emoji
      Returns:
      List of role IDs allowed.
    • user

      public User user()
      Description copied from interface: Emoji
      User who uploaded this emoji.
      Always null for unicode emoji.
      Specified by:
      user in interface Emoji
      Returns:
      User who uploaded the emoji.
    • requiresColons

      public boolean requiresColons()
      Description copied from interface: Emoji
      Whether this emoji must be wrapped in colons.
      Specified by:
      requiresColons in interface Emoji
      Returns:
      True if it should be wrapped in colons, false otherwise.
    • managed

      public boolean managed()
      Description copied from interface: Emoji
      Whether this emoji is managed.
      Always false for unicode emoji.
      Specified by:
      managed in interface Emoji
      Returns:
      True if it's managed, false otherwise.
    • animated

      public boolean animated()
      Description copied from interface: Emoji
      Whether this emoji is animated.
      Always false for unicode emoji.
      Specified by:
      animated in interface Emoji
      Returns:
      True if it's animated, false otherwise.
    • idAsLong

      public CustomEmojiImpl idAsLong(long idAsLong)
      Returns:
      this.
    • guildIdAsLong

      public CustomEmojiImpl guildIdAsLong(long guildIdAsLong)
      Returns:
      this.
    • name

      public CustomEmojiImpl name(String name)
      Returns:
      this.
    • roles

      public CustomEmojiImpl roles(List<String> roles)
      Returns:
      this.
    • user

      public CustomEmojiImpl user(User user)
      Returns:
      this.
    • requiresColons

      public CustomEmojiImpl requiresColons(boolean requiresColons)
      Returns:
      this.
    • managed

      public CustomEmojiImpl managed(boolean managed)
      Returns:
      this.
    • animated

      public CustomEmojiImpl animated(boolean animated)
      Returns:
      this.