Class ChatMessageSerializer

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      static String messageToJson(ChatMessage message) Serializes a chat message into a JSON string.
      static String messagesToJson(List<ChatMessage> messages) Serializes a list of chat messages into a JSON string.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ChatMessageSerializer

        ChatMessageSerializer()
    • Method Detail

      • messageToJson

         static String messageToJson(ChatMessage message)

        Serializes a chat message into a JSON string.

        Parameters:
        message - Chat message to be serialized.
        Returns:

        A JSON string with the contents of the message.

      • messagesToJson

         static String messagesToJson(List<ChatMessage> messages)

        Serializes a list of chat messages into a JSON string.

        Parameters:
        messages - The list of chat messages to be serialized.
        Returns:

        A JSON string representing provided chat messages.