Class MessageParser

java.lang.Object
com.symphony.bdk.core.service.message.util.MessageParser

@API(status=EXPERIMENTAL) public final class MessageParser extends Object
Helper class for extracting entities inside an incoming V4Message such as: Mentions, Hashtags, Cashtags, Emojis.
  • Constructor Details

    • MessageParser

      public MessageParser()
  • Method Details

    • getMentions

      public static List<Long> getMentions(V4Message message) throws MessageParserException
      Parse data inside the message and returns a list containing the user ids corresponding to the users mentioned
      Parameters:
      message - incoming V4 message to be parsed
      Returns:
      list of users ids that has been mentioned inside the message
      Throws:
      MessageParserException
    • getHashtags

      public static List<String> getHashtags(V4Message message) throws MessageParserException
      Parse data inside the message and returns a list containing the text of the hashtags found
      Parameters:
      message - incoming V4 message to be parsed
      Returns:
      list of hashtags contained in the message
      Throws:
      MessageParserException
    • getCashtags

      public static List<String> getCashtags(V4Message message) throws MessageParserException
      Parse data inside the message and returns a list containing the text of the cashtags found
      Parameters:
      message - incoming V4 message to be parsed
      Returns:
      list of cashtags contained in the message
      Throws:
      MessageParserException
    • getEmojis

      public static Map<String,String> getEmojis(V4Message message) throws MessageParserException
      Parse data inside the message and returns a map containing the list of emojis found. Key of the map are the annotation used to identify the emoji and the values are the their unicode.
      Parameters:
      message - incoming V4 message to be parsed
      Returns:
      map of emojis contained in the message
      Throws:
      MessageParserException