Class MessageProcessingHelper


  • public class MessageProcessingHelper
    extends Object
    Contains utility methods to process messages
    • Constructor Detail

      • MessageProcessingHelper

        public MessageProcessingHelper()
    • Method Detail

      • processDate

        public static String processDate​(String message)
        Process a message, using the string between # and # as date pattern for today, example: "We are on #MM/yyyy#" on january, 2006, would result in "We are on 01/2006"
      • processDate

        public static String processDate​(String message,
                                         Date date)
        Process a message, using the string between # and # as date pattern for the specified date, example: "We are on #MM/yyyy#" on january, 2006, would result in "We are on 01/2006"
      • processVariables

        public static String processVariables​(String message,
                                              Map<String,​?> values)
        Process a message, replacing the specified variables between # and # example: "The member #member# paid you #amount# units." with the values map containing member => John; amount => 4 will result in "The member John paid you 4 units".