Package org.javacord.api.entity.emoji
Interface Emoji
-
- All Superinterfaces:
Mentionable,Specializable<Emoji>
- All Known Subinterfaces:
CustomEmoji,KnownCustomEmoji
public interface Emoji extends Mentionable, Specializable<Emoji>
This class represents an emoji which can be a custom emoji (known or unknown) or a unicode emoji.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Optional<CustomEmoji>asCustomEmoji()Gets the emoji as custom emoji.default Optional<KnownCustomEmoji>asKnownCustomEmoji()Gets the emoji as known custom emoji.Optional<String>asUnicodeEmoji()Gets the emoji as unicode emoji.default booleanequalsEmoji(String otherEmoji)Checks if the emoji is equal to the given unicode emoji.default booleanequalsEmoji(Emoji otherEmoji)Checks if the emoji is equal to the given emoji.booleanisAnimated()Checks if the emoji is animated.default booleanisCustomEmoji()Checks if the emoji is a custom emoji.default booleanisKnownCustomEmoji()Checks if the emoji is a known custom emoji.default booleanisUnicodeEmoji()Checks if the emoji is a unicode.-
Methods inherited from interface org.javacord.api.entity.Mentionable
getMentionTag
-
Methods inherited from interface org.javacord.api.util.Specializable
as
-
-
-
-
Method Detail
-
asUnicodeEmoji
Optional<String> asUnicodeEmoji()
Gets the emoji as unicode emoji.- Returns:
- The emoji as unicode emoji.
-
asCustomEmoji
default Optional<CustomEmoji> asCustomEmoji()
Gets the emoji as custom emoji.- Returns:
- The emoji as custom emoji.
-
asKnownCustomEmoji
default Optional<KnownCustomEmoji> asKnownCustomEmoji()
Gets the emoji as known custom emoji.- Returns:
- The emoji as known custom emoji.
-
equalsEmoji
default boolean equalsEmoji(Emoji otherEmoji)
Checks if the emoji is equal to the given emoji. This can be used to safe some ugly optional checks.- Parameters:
otherEmoji- The emoji to compare with.- Returns:
- Whether the emoji is equal to the given emoji.
-
equalsEmoji
default boolean equalsEmoji(String otherEmoji)
Checks if the emoji is equal to the given unicode emoji. This can be used to safe some ugly optional checks.- Parameters:
otherEmoji- The unicode emoji to compare with.- Returns:
- Whether the emoji is equal to the given unicode emoji.
-
isAnimated
boolean isAnimated()
Checks if the emoji is animated. Always returnsfalsefor unicode emojis.- Returns:
- Whether the emoji is animated or not.
-
isUnicodeEmoji
default boolean isUnicodeEmoji()
Checks if the emoji is a unicode.- Returns:
- Whether the emoji is a unicode emoji or not.
-
isCustomEmoji
default boolean isCustomEmoji()
Checks if the emoji is a custom emoji.- Returns:
- Whether the emoji is a custom emoji or not.
-
isKnownCustomEmoji
default boolean isKnownCustomEmoji()
Checks if the emoji is a known custom emoji.- Returns:
- Whether the emoji is a known custom emoji or not.
-
-