java.lang.Object
net.fellbaum.jemoji.Emoji
- All Implemented Interfaces:
Comparable<Emoji>
Represents an emoji along with its properties such as Unicode representation,
HTML codes, aliases, keywords, and grouping details.
-
Method Summary
Modifier and TypeMethodDescriptionintCompares the emojis based on their codepoint length, and if they are equal, compare them lexicographically based on the emoji.booleanGets all the aliases for this emoji.Gets the description of this emoji.getDescription(EmojiLanguage emojiLanguage) Gets the description of this emoji in the specified language.Gets the Discord aliases for this emoji.getEmoji()Gets the emoji value 🙂.int[]Gets the pre-computed codepoint array of this emoji's string.Gets the emoji representation of this emoji if the emoji is a standardized emoji that allows variations.Gets the GitHub aliases for this emoji.getGroup()Gets the group or "category" this emoji belongs to.Gets the HTML decimal code for this emoji.Gets the HTML hexadecimal code for this emoji.Gets the keywords of this emoji.getKeywords(EmojiLanguage emojiLanguage) Gets the keywords of this emoji in the specified language.Gets the qualification of this emoji.Gets the Slack aliases for this emoji.Gets the subgroup of this emoji.Gets the text representation of this emoji if the emoji is a standardized emoji that allows variations.Deprecated.Gets the Unicode representation of the emoji as a string i.e.Gets the URL encoded emoji.Gets variations of this emoji with different Fitzpatrick or HairStyle modifiers if there are any.doubleGets the version this emoji was added to the Unicode consortium.booleanChecks if this emoji has a fitzpatrick modifier.booleanChecks if this emoji has a hairstyle modifier.inthashCode()booleanReturns whether the emoji has text or emoji variations.toString()
-
Method Details
-
getEmojiCodePoints
public int[] getEmojiCodePoints()Gets the pre-computed codepoint array of this emoji's string.- Returns:
- The codepoint array of this emoji.
-
getEmoji
Gets the emoji value 🙂.- Returns:
- The emoji
-
getUnicode
Deprecated.UsegetUnicodeText()insteadGets the Unicode representation of the emoji as a string i.e. \\uD83D\\uDE42 instead of displaying the actual emoji 🙂.- Returns:
- The Unicode representation of the emoji
-
getUnicodeText
Gets the Unicode representation of the emoji as a string i.e. \\uD83D\\uDE42 instead of displaying the actual emoji 🙂.- Returns:
- The Unicode representation of the emoji
-
getHtmlDecimalCode
Gets the HTML decimal code for this emoji.- Returns:
- The HTML decimal code for this emoji.
-
getHtmlHexadecimalCode
Gets the HTML hexadecimal code for this emoji.- Returns:
- The HTML hexadecimal code for this emoji.
-
getVariations
Gets variations of this emoji with different Fitzpatrick or HairStyle modifiers if there are any. The returned list does not include this emoji itself.- Returns:
- Variations of this emoji with different Fitzpatrick or HairStyle modifiers, if there are any.
-
getURLEncoded
Gets the URL encoded emoji.- Returns:
- The URL encoded emoji
-
getDiscordAliases
Gets the Discord aliases for this emoji. If possible, do not use the :name::skin-tone-1: variants as they might not produce the emoji you want.- Returns:
- The Discord aliases for this emoji.
-
getGithubAliases
Gets the GitHub aliases for this emoji.- Returns:
- The GitHub aliases for this emoji.
-
getSlackAliases
Gets the Slack aliases for this emoji.- Returns:
- The Slack aliases for this emoji.
-
getAllAliases
Gets all the aliases for this emoji.- Returns:
- All the aliases for this emoji.
-
hasFitzpatrickComponent
public boolean hasFitzpatrickComponent()Checks if this emoji has a fitzpatrick modifier.- Returns:
- True if this emoji has a fitzpatrick modifier, false otherwise.
-
hasHairStyleComponent
public boolean hasHairStyleComponent()Checks if this emoji has a hairstyle modifier.- Returns:
- True if this emoji has a hairstyle modifier, false otherwise.
-
getVersion
public double getVersion()Gets the version this emoji was added to the Unicode consortium.- Returns:
- The version this emoji was added to the Unicode consortium.
-
getQualification
Gets the qualification of this emoji.- Returns:
- The qualification of this emoji.
-
getDescription
Gets the description of this emoji.- Returns:
- The description of this emoji.
-
getDescription
Gets the description of this emoji in the specified language. May not be present for all languages.- Parameters:
emojiLanguage- The language type the description should be searched for.- Returns:
- The description of this emoji in the specified language.
-
getKeywords
Gets the keywords of this emoji.- Returns:
- The keywords of this emoji.
-
getKeywords
Gets the keywords of this emoji in the specified language. May not be present for all languages.- Parameters:
emojiLanguage- The language type the keywords should be searched for.- Returns:
- The keywords of this emoji in the specified language.
-
getGroup
Gets the group or "category" this emoji belongs to.- Returns:
- The group this emoji belongs to.
-
getSubgroup
Gets the subgroup of this emoji.- Returns:
- The subgroup of this emoji.
-
hasVariationSelectors
public boolean hasVariationSelectors()Returns whether the emoji has text or emoji variations. This means the emoji is allowed to be appended with a FE0E or FE0F character to control how the emoji should be displayed.- Returns:
- Whether the emoji is a standardized emoji that can be appended with a Variation Selector.
- See Also:
-
getTextVariation
Gets the text representation of this emoji if the emoji is a standardized emoji that allows variations.- Returns:
- The text variation of this emoji.
-
getEmojiVariation
Gets the emoji representation of this emoji if the emoji is a standardized emoji that allows variations.- Returns:
- The emoji variation of this emoji.
-
compareTo
Compares the emojis based on their codepoint length, and if they are equal, compare them lexicographically based on the emoji.- Specified by:
compareToin interfaceComparable<Emoji>- Parameters:
o- the object to be compared.- Returns:
- Zero if they are fully equal, 1 if the emoji has more codepoints and has a higher Unicode value, otherwise return -1
-
toString
-
equals
-
hashCode
public int hashCode()
-
getUnicodeText()instead