Package com.vdurmont.emoji
Class EmojiManager
- java.lang.Object
-
- com.vdurmont.emoji.EmojiManager
-
public class EmojiManager extends Object
Holds the loaded emojis and provides search functions.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancontainsEmoji(@NotNull String string)Tests if a given String contains an emoji.static @NotNull List<Emoji>getAll()Returns all theEmojisstatic @NotNull Set<String>getAllTags()Returns all the tags in the databasestatic @Nullable EmojigetByUnicode(@NotNull String unicode)Returns theEmojifor a given unicode.static @Nullable EmojigetForAlias(@NotNull String alias)Returns theEmojifor a given alias.static @NotNull Set<Emoji>getForCategory(@NotNull EmojiCategory category)Returns all theEmojisfor a given category.static @NotNull Set<Emoji>getForTag(@NotNull String tag)Returns all theEmojisfor a given tag.static EmojiTrie.MatchesisEmoji(@org.jetbrains.annotations.NotNull char[] sequence)Checks if sequence of chars contain an emoji.static booleanisEmoji(@NotNull String string)Tests if a given String is an emoji.static booleanisOnlyEmojis(@NotNull String string)Tests if a given String only contains emojis.
-
-
-
Method Detail
-
getForTag
@NotNull public static @NotNull Set<Emoji> getForTag(@NotNull @NotNull String tag)
Returns all theEmojisfor a given tag.- Parameters:
tag- the tag- Returns:
SetofEmojis, empty set if the tag is unknown- See Also:
getAllTags()
-
getForCategory
@NotNull public static @NotNull Set<Emoji> getForCategory(@NotNull @NotNull EmojiCategory category)
Returns all theEmojisfor a given category.- Parameters:
category- theEmojiCategory- Returns:
SetofEmojis, empty set if the category is unknown or null
-
getForAlias
@Nullable public static @Nullable Emoji getForAlias(@NotNull @NotNull String alias)
Returns theEmojifor a given alias.- Parameters:
alias- the alias- Returns:
- The associated
Emoji, null if the alias is unknown
-
getByUnicode
@Nullable public static @Nullable Emoji getByUnicode(@NotNull @NotNull String unicode)
Returns theEmojifor a given unicode.- Parameters:
unicode- the unicode- Returns:
- The associated
Emoji, null if the unicode is unknown
-
getAll
@NotNull public static @NotNull List<Emoji> getAll()
Returns all theEmojis- Returns:
- Immutable list of all the
Emojis
-
isEmoji
public static boolean isEmoji(@NotNull @NotNull String string)Tests if a given String is an emoji.- Parameters:
string- the string to test- Returns:
- true, if the string is an emoji's unicode, false otherwise
-
containsEmoji
public static boolean containsEmoji(@NotNull @NotNull String string)Tests if a given String contains an emoji.- Parameters:
string- the string to test- Returns:
- true, if the string contains an emoji's unicode, false otherwise
-
isOnlyEmojis
public static boolean isOnlyEmojis(@NotNull @NotNull String string)Tests if a given String only contains emojis.- Parameters:
string- the string to test- Returns:
- true, if the string only contains emojis, false otherwise
-
isEmoji
@NotNull public static EmojiTrie.Matches isEmoji(@NotNull @org.jetbrains.annotations.NotNull char[] sequence)
Checks if sequence of chars contain an emoji.- Parameters:
sequence- Sequence of char that may contain emoji in full or partially.- Returns:
EmojiTrie.Matches.EXACTLYif char sequence in its entirety is an emojiEmojiTrie.Matches.POSSIBLYif char sequence matches prefix of an emojiEmojiTrie.Matches.IMPOSSIBLEif char sequence matches no emoji or prefix of an emoji
-
-