Interface ChatMessageJsonCodec
- All Known Implementing Classes:
JacksonChatMessageJsonCodec
public interface ChatMessageJsonCodec
A codec for serializing and deserializing
ChatMessage objects to and from JSON.-
Method Summary
Modifier and TypeMethodDescriptionmessageFromJson(String json) Deserializes a JSON string to aChatMessageobject.messagesFromJson(String json) Deserializes a JSON string to a list ofChatMessageobjects.messagesToJson(List<ChatMessage> messages) Serializes a list ofChatMessageobjects to a JSON string.messageToJson(ChatMessage message) Serializes aChatMessageobject to a JSON string.
-
Method Details
-
messageFromJson
Deserializes a JSON string to aChatMessageobject.- Parameters:
json- the JSON string.- Returns:
- the deserialized
ChatMessageobject.
-
messagesFromJson
Deserializes a JSON string to a list ofChatMessageobjects.- Parameters:
json- the JSON string.- Returns:
- the deserialized list of
ChatMessageobjects.
-
messageToJson
Serializes aChatMessageobject to a JSON string.- Parameters:
message- theChatMessageobject.- Returns:
- the serialized JSON string.
-
messagesToJson
Serializes a list ofChatMessageobjects to a JSON string.- Parameters:
messages- the list ofChatMessageobjects.- Returns:
- the serialized JSON string.
-