Class EmojiUtils

java.lang.Object
net.fellbaum.jemoji.internal.EmojiUtils

public final class EmojiUtils extends Object
  • Field Details

    • TEXT_VARIATION_CHARACTER

      public static final char TEXT_VARIATION_CHARACTER
      See Also:
    • EMOJI_VARIATION_CHARACTER

      public static final char EMOJI_VARIATION_CHARACTER
      See Also:
  • Method Details

    • getCodePointCount

      public static int getCodePointCount(String string)
    • isStringNullOrEmpty

      public static boolean isStringNullOrEmpty(@Nullable String string)
    • removeColonFromAlias

      public static String removeColonFromAlias(String alias)
    • addColonToAlias

      public static String addColonToAlias(String alias)
    • findEmojiByEitherAlias

      public static Optional<List<Emoji>> findEmojiByEitherAlias(Map<CodepointSequence,List<Emoji>> map, String alias)
    • stringToCodePoints

      public static int[] stringToCodePoints(String text)
    • findUniqueEmoji

      public static @Nullable UniqueEmojiFoundResult findUniqueEmoji(int[] textCodePointsArray, int textIndex, long textCodePointsLength, EmojiType type)
      Finds a unique emoji starting at the position textIndex in the textCodePointsArray.
      Parameters:
      textCodePointsArray - The textCodePointsArray to check if it contains an emoji.
      textIndex - The current text index.
      textCodePointsLength - The length of the textCodePointsArray.
      type - The EmojiType to check the codepoint against.
      Returns:
      The found emoji, otherwise null.
    • findNonUniqueEmoji

      public static @Nullable NonUniqueEmojiFoundResult findNonUniqueEmoji(int[] textCodePointsArray, int textIndex, long textCodePointsLength)
      Finds a unique emoji starting at the position textIndex in the textCodePointsArray.
      Parameters:
      textCodePointsArray - The textCodePointsArray to check if it contains an emoji.
      textIndex - The current text index.
      textCodePointsLength - The length of the textCodePointsArray.
      Returns:
      The found emoji, otherwise null.
    • checkIfCodepointIsInvalidEmojiStarter

      public static boolean checkIfCodepointIsInvalidEmojiStarter(int currentCodepoint)
      Checks if the codepoint is a valid starter character for any EmojiType. This avoids running unnecessary for loops which take ~1ms longer.
      Parameters:
      currentCodepoint - The codepoint to check.
      Returns:
      Whether the codepoint is a valid starter.