-
Method Summary
Modifier and TypeMethodDescriptionstatic booleancontainsAnyEmoji(String text) Checks if the given text contains emojis.static booleancontainsAnyEmoji(String text, EnumSet<EmojiType> emojiType) Checks if the given text contains emojis.extractAliases(String text) Extracts all aliases from the given text.extractAliasesInOrder(String text) Extracts all aliases from the given text in the order they appear.static List<IndexedAlias>Extracts all aliases from the given text in the order they appear.extractEmojis(String text) Extracts all emojis from the given text.extractEmojis(String text, EnumSet<EmojiType> emojiType) Extracts all emojis from the given text.extractEmojisInOrder(String text) Extracts all emojis from the given text in the order they appear.extractEmojisInOrder(String text, EnumSet<EmojiType> emojiType) Extracts all emojis from the given text in the order they appear.static List<IndexedEmoji>Extracts all emojis from the given text in the order they appear.static List<IndexedEmoji>extractEmojisInOrderWithIndex(String text, EnumSet<EmojiType> emojiType) Extracts all emojis from the given text in the order they appear.Gets all emojis.getAllEmojisByGroup(EmojiGroup group) Gets all emojis that are part of the given group.getAllEmojisBySubGroup(EmojiSubGroup subgroup) Gets all emojis that are part of the given subgroup.static Map<EmojiGroup,Set<Emoji>> Gets all emojis mapped to their group.Gets all emojis in descending order by their char length.static Map<EmojiSubGroup,Set<Emoji>> Gets all emojis mapped to their subgroup.getByAlias(String alias) Gets an emoji for the given alias i.e.getByDiscordAlias(String alias) Gets an emoji for the given Discord alias i.e.getByGithubAlias(String alias) Gets an emoji for the given GitHub alias i.e.getByHtmlDecimal(String htmlDecimal) Gets an emoji for the given HTML decimal i.e.getByHtmlHexadecimal(String htmlHexadecimal) Gets an emoji for the given HTML hexadecimal i.e.getBySlackAlias(String alias) Gets an emoji for the given Slack alias i.e.getByUrlEncoded(String urlEncodedEmoji) Gets an emoji for the given url encoded emoji i.e.Returns the emoji for the given Unicode.static PatternGets the pattern checking for all emojis.static booleanCheck if the given string is an emoji.static StringremoveAllEmojis(String text) Removes all emojis from the given text.static StringremoveAllEmojis(String text, EnumSet<EmojiType> emojiType) Removes all emojis from the given text.static StringremoveAllEmojisExcept(String text, Collection<Emoji> emojisToKeep) Removes all emojis except the given emojis from the given text.static StringremoveAllEmojisExcept(String text, Collection<Emoji> emojisToKeep, EnumSet<EmojiType> emojiType) Removes all emojis except the given emojis from the given text.static StringremoveAllEmojisExcept(String text, Emoji... emojisToKeep) Removes all emojis except the given emojis from the given text.static StringremoveEmojis(String text, Collection<Emoji> emojisToRemove) Removes the given emojis from the given text.static StringremoveEmojis(String text, Collection<Emoji> emojisToRemove, EnumSet<EmojiType> emojiType) Removes the given emojis from the given text.static StringremoveEmojis(String text, Emoji... emojisToRemove) Removes the given emojis from the given text.static StringreplaceAliases(String text, BiFunction<String, List<Emoji>, String> replacementFunction) Replaces all aliases in the text with the given replacement function.static StringreplaceAllEmojis(String text, String replacementString) Replaces all emojis in the text with the given replacement string.static StringreplaceAllEmojis(String text, String replacementString, EnumSet<EmojiType> emojiType) Replaces all emojis in the text with the given replacement string.static StringreplaceAllEmojis(String text, Function<Emoji, String> replacementFunction) Replaces all emojis in the text with the given replacement function.static StringreplaceAllEmojis(String text, Function<Emoji, String> replacementFunction, EnumSet<EmojiType> emojiType) Replaces all emojis in the text with the given replacement function.static StringreplaceEmojis(String text, String replacementString, Collection<Emoji> emojisToReplace) Replaces the given emojis with the given replacement string.static StringreplaceEmojis(String text, String replacementString, Collection<Emoji> emojisToReplace, EnumSet<EmojiType> emojiType) Replaces the given emojis with the given replacement string.static StringreplaceEmojis(String text, String replacementString, Emoji... emojisToReplace) Replaces the given emojis with the given replacement string.static StringreplaceEmojis(String text, Function<Emoji, String> replacementFunction, Collection<Emoji> emojisToReplace) Replaces all emojis in the text with the given replacement function.static StringreplaceEmojis(String text, Function<Emoji, String> replacementFunction, Collection<Emoji> emojisToReplace, EnumSet<EmojiType> emojiType) Replaces all emojis in the text with the given replacement function.
-
Method Details
-
getEmoji
Returns the emoji for the given Unicode.- Parameters:
emoji- The Unicode of the emoji.- Returns:
- The emoji.
-
isEmoji
Check if the given string is an emoji.- Parameters:
emoji- The emoji to check.- Returns:
- True if the given string is an emoji.
-
getAllEmojis
Gets all emojis.- Returns:
- A set of all emojis.
-
getAllEmojisGrouped
Gets all emojis mapped to their group.- Returns:
- A map of all emojis mapped to their group.
-
getAllEmojisSubGrouped
Gets all emojis mapped to their subgroup.- Returns:
- A map of all emojis mapped to their subgroup.
-
getAllEmojisByGroup
Gets all emojis that are part of the given group.- Parameters:
group- The group to get the emojis for.- Returns:
- A set of all emojis that are part of the given group.
-
getAllEmojisBySubGroup
Gets all emojis that are part of the given subgroup.- Parameters:
subgroup- The subgroup to get the emojis for.- Returns:
- A set of all emojis that are part of the given subgroup.
-
getAllEmojisLengthDescending
Gets all emojis in descending order by their char length.- Returns:
- A list of all emojis.
-
getByHtmlDecimal
Gets an emoji for the given HTML decimal i.e. 👍 (thumbsup emoji) if present.- Parameters:
htmlDecimal- The HTML decimal of the emoji.- Returns:
- The emoji.
-
getByHtmlHexadecimal
Gets an emoji for the given HTML hexadecimal i.e. 👍 (thumbsup emoji) if present.- Parameters:
htmlHexadecimal- The HTML hexadecimal of the emoji.- Returns:
- The emoji.
-
getByUrlEncoded
Gets an emoji for the given url encoded emoji i.e. %F0%9F%91%8D (thumbsup emoji) if present.- Parameters:
urlEncodedEmoji- The HTML hexadecimal of the emoji.- Returns:
- The emoji.
-
getByAlias
Gets an emoji for the given alias i.e. :thumbsup: if present.- Parameters:
alias- The alias of the emoji.- Returns:
- The emoji.
-
getByDiscordAlias
Gets an emoji for the given Discord alias i.e. :thumbsup: if present.- Parameters:
alias- The Discord alias of the emoji.- Returns:
- The emoji.
-
getByGithubAlias
Gets an emoji for the given GitHub alias i.e. :thumbsup: if present.- Parameters:
alias- The GitHub alias of the emoji.- Returns:
- The emoji.
-
getBySlackAlias
Gets an emoji for the given Slack alias i.e. :thumbsup: if present.- Parameters:
alias- The Slack alias of the emoji.- Returns:
- The emoji.
-
getEmojiPattern
Gets the pattern checking for all emojis.- Returns:
- The pattern for all emojis.
-
containsAnyEmoji
Checks if the given text contains emojis.- Parameters:
text- The text to check.- Returns:
- True if the given text contains emojis.
-
containsAnyEmoji
Checks if the given text contains emojis.- Parameters:
text- The text to check.emojiType- The type of the emoji appearance in the string which should be checked against.- Returns:
- True if the given text contains emojis.
-
extractEmojis
Extracts all emojis from the given text.- Parameters:
text- The text to extract emojis from.- Returns:
- A list of emojis.
-
extractEmojis
Extracts all emojis from the given text.- Parameters:
text- The text to extract emojis from.emojiType- The type of the emoji appearance in the string which should be extracted.- Returns:
- A list of emojis.
-
extractEmojisInOrder
Extracts all emojis from the given text in the order they appear.- Parameters:
text- The text to extract emojis from.- Returns:
- A list of emojis.
-
extractEmojisInOrder
Extracts all emojis from the given text in the order they appear.- Parameters:
text- The text to extract emojis from.emojiType- The type of the emoji appearance in the string which should be extracted.- Returns:
- A list of emojis.
-
extractEmojisInOrderWithIndex
Extracts all emojis from the given text in the order they appear.- Parameters:
text- The text to extract emojis from.- Returns:
- A list of indexed emojis.
-
extractEmojisInOrderWithIndex
public static List<IndexedEmoji> extractEmojisInOrderWithIndex(String text, EnumSet<EmojiType> emojiType) Extracts all emojis from the given text in the order they appear.- Parameters:
text- The text to extract emojis from.emojiType- The type of the emoji appearance in the string which should be extracted.- Returns:
- A list of indexed emojis.
-
removeAllEmojis
Removes all emojis from the given text.- Parameters:
text- The text to remove emojis from.- Returns:
- The text without emojis.
-
removeAllEmojis
Removes all emojis from the given text.- Parameters:
text- The text to remove emojis from.emojiType- The type of the emoji appearance in the string which should be removed.- Returns:
- The text without emojis.
-
removeEmojis
Removes the given emojis from the given text.- Parameters:
text- The text to remove emojis from.emojisToRemove- The emojis to remove.- Returns:
- The text without the given emojis.
-
removeEmojis
Removes the given emojis from the given text.- Parameters:
text- The text to remove emojis from.emojisToRemove- The emojis to remove.- Returns:
- The text without the given emojis.
-
removeEmojis
public static String removeEmojis(String text, Collection<Emoji> emojisToRemove, EnumSet<EmojiType> emojiType) Removes the given emojis from the given text.- Parameters:
text- The text to remove emojis from.emojisToRemove- The emojis to remove.emojiType- The type of the emoji appearance in the string which should be removed.- Returns:
- The text without the given emojis.
-
removeAllEmojisExcept
Removes all emojis except the given emojis from the given text.- Parameters:
text- The text to remove emojis from.emojisToKeep- The emojis to keep.- Returns:
- The text with only the given emojis.
-
removeAllEmojisExcept
Removes all emojis except the given emojis from the given text.- Parameters:
text- The text to remove emojis from.emojisToKeep- The emojis to keep.- Returns:
- The text with only the given emojis.
-
removeAllEmojisExcept
public static String removeAllEmojisExcept(String text, Collection<Emoji> emojisToKeep, EnumSet<EmojiType> emojiType) Removes all emojis except the given emojis from the given text.- Parameters:
text- The text to remove emojis from.emojisToKeep- The emojis to keep.emojiType- The type of the emoji appearance in the string which should be removed.- Returns:
- The text with only the given emojis.
-
replaceAllEmojis
Replaces all emojis in the text with the given replacement string.- Parameters:
text- The text to replace emojis from.replacementString- The replacement string.- Returns:
- The text with all emojis replaced.
-
replaceAllEmojis
public static String replaceAllEmojis(String text, String replacementString, EnumSet<EmojiType> emojiType) Replaces all emojis in the text with the given replacement string.- Parameters:
text- The text to replace emojis from.replacementString- The replacement string.emojiType- The type of the emoji appearance in the string which should be replaced.- Returns:
- The text with all emojis replaced.
-
replaceAllEmojis
Replaces all emojis in the text with the given replacement function.- Parameters:
text- The text to replace emojis from.replacementFunction- The replacement function.- Returns:
- The text with all emojis replaced.
-
replaceAllEmojis
public static String replaceAllEmojis(String text, Function<Emoji, String> replacementFunction, EnumSet<EmojiType> emojiType) Replaces all emojis in the text with the given replacement function.- Parameters:
text- The text to replace emojis from.replacementFunction- The replacement function.emojiType- The type of the emoji appearance in the string which should be replaced.- Returns:
- The text with all emojis replaced.
-
replaceEmojis
public static String replaceEmojis(String text, String replacementString, Collection<Emoji> emojisToReplace) Replaces the given emojis with the given replacement string.- Parameters:
text- The text to replace emojis from.replacementString- The replacement string.emojisToReplace- The emojis to replace.- Returns:
- The text with the given emojis replaced.
-
replaceEmojis
public static String replaceEmojis(String text, String replacementString, Collection<Emoji> emojisToReplace, EnumSet<EmojiType> emojiType) Replaces the given emojis with the given replacement string.- Parameters:
text- The text to replace emojis from.replacementString- The replacement string.emojisToReplace- The emojis to replace.emojiType- The type of the emoji appearance in the string which should be replaced.- Returns:
- The text with the given emojis replaced.
-
replaceEmojis
Replaces the given emojis with the given replacement string.- Parameters:
text- The text to replace emojis from.replacementString- The replacement string.emojisToReplace- The emojis to replace.- Returns:
- The text with the given emojis replaced.
-
replaceEmojis
public static String replaceEmojis(String text, Function<Emoji, String> replacementFunction, Collection<Emoji> emojisToReplace) Replaces all emojis in the text with the given replacement function.- Parameters:
text- The text to replace emojis from.replacementFunction- The replacement function.emojisToReplace- The emojis to replace.- Returns:
- The text with all emojis replaced.
-
replaceEmojis
public static String replaceEmojis(String text, Function<Emoji, String> replacementFunction, Collection<Emoji> emojisToReplace, EnumSet<EmojiType> emojiType) Replaces all emojis in the text with the given replacement function.- Parameters:
text- The text to replace emojis from.replacementFunction- The replacement function.emojisToReplace- The emojis to replace.emojiType- The type of the emoji appearance in the string which should be replaced.- Returns:
- The text with all emojis replaced.
-
replaceAliases
public static String replaceAliases(String text, BiFunction<String, List<Emoji>, String> replacementFunction) Replaces all aliases in the text with the given replacement function.- Parameters:
text- The text to replace aliases from.replacementFunction- A non-empty list. Always contains at least one emoji, but there may be more than 1 available for one alias. Therefore, it's up to you to decide which one you take.For example, when replacing the alias ":beach_umbrella:", these two emojis will be available. {emoji='🏖️', unicode='🏖️', discordAliases=[:beach:, :beach_with_umbrella:], githubAliases=[:beach_umbrella:], slackAliases=[:beach_with_umbrella:], hasFitzpatrick=false, hasHairStyle=false, version=0.7, qualification=FULLY_QUALIFIED, description='beach with umbrella', group=TRAVEL_AND_PLACES, subgroup=PLACE_GEOGRAPHIC, hasVariationSelectors=false, allAliases=[:beach:, :beach_umbrella:, :beach_with_umbrella:]}, {emoji='⛱️', unicode='⛱️', discordAliases=[:beach_umbrella:, :umbrella_on_ground:], githubAliases=[:parasol_on_ground:], slackAliases=[:umbrella_on_ground:], hasFitzpatrick=false, hasHairStyle=false, version=0.7, qualification=FULLY_QUALIFIED, description='umbrella on ground', group=TRAVEL_AND_PLACES, subgroup=SKY_AND_WEATHER, hasVariationSelectors=false, allAliases=[:beach_umbrella:, :umbrella_on_ground:, :parasol_on_ground:]}
- Returns:
- The text with the aliases replaced.
-
extractAliases
Extracts all aliases from the given text.- Parameters:
text- The text to extract aliases from.- Returns:
- A set of aliases.
-
extractAliasesInOrder
Extracts all aliases from the given text in the order they appear.- Parameters:
text- The text to extract aliases from.- Returns:
- A list of aliases.
-
extractAliasesInOrderWithIndex
Extracts all aliases from the given text in the order they appear.- Parameters:
text- The text to extract aliases from.- Returns:
- A list of indexed aliases.
-