Package com.vdurmont.emoji
Class Emoji
- java.lang.Object
-
- com.vdurmont.emoji.Emoji
-
public class Emoji extends Object
This class represents an emoji.This object is immutable, so it can be used safely in a multi-threaded context.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object other)@NotNull List<String>getAliases()Returns the aliases of the emoji@NotNull EmojiCategorygetCategory()Returns theEmojiCategoryfor this emoji@NotNull StringgetDescription()Returns the description of the emoji@NotNull StringgetHtmlDecimal()Returns the HTML decimal representation of the emoji@NotNull StringgetHtmlHexadecimal()Returns the HTML hexadecimal representation of the emoji@NotNull List<String>getTags()Returns the tags of the emoji@NotNull StringgetTrimmedUnicode()Returns the unicode representation of the emoji without the variation selector@NotNull StringgetTrimmedUnicode(@Nullable Fitzpatrick fitzpatrick)Returns the unicode representation of the emoji associated with the provided Fitzpatrick modifier.@NotNull StringgetUnicode()Returns the unicode representation of the emoji@NotNull StringgetUnicode(@Nullable Fitzpatrick fitzpatrick)Returns the unicode representation of the emoji associated with the provided Fitzpatrick modifier.inthashCode()booleansupportsFitzpatrick()Returns whether the emoji supports the Fitzpatrick modifiers or notbooleansupportsVariation()Returns whether the emoji supports a variation selection modifier or not@NotNull StringtoString()Returns the String representation of the Emoji object.
-
-
-
Method Detail
-
getDescription
@NotNull public @NotNull String getDescription()
Returns the description of the emoji- Returns:
- the description
-
supportsFitzpatrick
public boolean supportsFitzpatrick()
Returns whether the emoji supports the Fitzpatrick modifiers or not- Returns:
- true if the emoji supports the Fitzpatrick modifiers
-
supportsVariation
public boolean supportsVariation()
Returns whether the emoji supports a variation selection modifier or not- Returns:
- true, if the emoji supports variation selector
-
getAliases
@NotNull public @NotNull List<String> getAliases()
Returns the aliases of the emoji- Returns:
- Immutable list of aliases
-
getTags
@NotNull public @NotNull List<String> getTags()
Returns the tags of the emoji- Returns:
- Immutable list if tags
-
getUnicode
@NotNull public @NotNull String getUnicode()
Returns the unicode representation of the emoji- Returns:
- the unicode representation
-
getTrimmedUnicode
@NotNull public @NotNull String getTrimmedUnicode()
Returns the unicode representation of the emoji without the variation selector- Returns:
- the unicode representation without variation selector
-
getCategory
@NotNull public @NotNull EmojiCategory getCategory()
Returns theEmojiCategoryfor this emoji- Returns:
- The
EmojiCategory
-
getUnicode
@NotNull public @NotNull String getUnicode(@Nullable @Nullable Fitzpatrick fitzpatrick)
Returns the unicode representation of the emoji associated with the provided Fitzpatrick modifier.
If the modifier is null, then the result is similar togetUnicode().- Parameters:
fitzpatrick- the fitzpatrick modifier or null- Returns:
- the unicode representation
- Throws:
IllegalStateException- if the emoji doesn't support the Fitzpatrick modifiers
-
getTrimmedUnicode
@NotNull public @NotNull String getTrimmedUnicode(@Nullable @Nullable Fitzpatrick fitzpatrick)
Returns the unicode representation of the emoji associated with the provided Fitzpatrick modifier.
If the modifier is null, then the result is similar togetTrimmedUnicode().- Parameters:
fitzpatrick- the fitzpatrick modifier or null- Returns:
- the unicode representation
- Throws:
IllegalStateException- if the emoji doesn't support the Fitzpatrick modifiers
-
getHtmlDecimal
@NotNull public @NotNull String getHtmlDecimal()
Returns the HTML decimal representation of the emoji- Returns:
- the HTML decimal representation
-
getHtmlHexadecimal
@NotNull public @NotNull String getHtmlHexadecimal()
Returns the HTML hexadecimal representation of the emoji- Returns:
- the HTML hexadecimal representation
-
toString
@NotNull public @NotNull String toString()
Returns the String representation of the Emoji object.Example
Emoji { description='smiling face with open mouth and smiling eyes', supportsFitzpatrick=false, aliases=[smile], tags=[happy, joy, pleased], category='Smileys & Emotion', unicode='😄', htmlDec='😄', htmlHex='😄' }
-
-