Class EmojiManager


  • public class EmojiManager
    extends Object
    Holds the loaded emojis and provides search functions.
    • Method Detail

      • getForTag

        @NotNull
        public static @NotNull Set<Emoji> getForTag​(@NotNull
                                                    @NotNull String tag)
        Returns all the Emojis for a given tag.
        Parameters:
        tag - the tag
        Returns:
        Set of Emojis, empty set if the tag is unknown
        See Also:
        getAllTags()
      • getForCategory

        @NotNull
        public static @NotNull Set<Emoji> getForCategory​(@NotNull
                                                         @NotNull EmojiCategory category)
        Returns all the Emojis for a given category.
        Parameters:
        category - the EmojiCategory
        Returns:
        Set of Emojis, empty set if the category is unknown or null
      • getForAlias

        @Nullable
        public static @Nullable Emoji getForAlias​(@NotNull
                                                  @NotNull String alias)
        Returns the Emoji for 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 the Emoji for 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 the Emojis
        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:
      • getAllTags

        @NotNull
        public static @NotNull Set<String> getAllTags()
        Returns all the tags in the database
        Returns:
        Immutable Set of known tags