Class ChatMesssageSerializer

java.lang.Object
org.bsc.langgraph4j.langchain4j.serializer.std.ChatMesssageSerializer
All Implemented Interfaces:
Serializer<dev.langchain4j.data.message.ChatMessage>

public class ChatMesssageSerializer extends Object implements Serializer<dev.langchain4j.data.message.ChatMessage>
The ChatMesssageSerializer class is responsible for serializing and deserializing ChatMessage objects. It implements the Serializer interface for the ChatMessage type.
  • Constructor Details

    • ChatMesssageSerializer

      public ChatMesssageSerializer()
  • Method Details

    • write

      public void write(dev.langchain4j.data.message.ChatMessage object, ObjectOutput out) throws IOException
      Serializes the given ChatMessage object to the specified output stream.
      Specified by:
      write in interface Serializer<dev.langchain4j.data.message.ChatMessage>
      Parameters:
      object - the ChatMessage object to serialize
      out - the output stream to write the serialized object to
      Throws:
      IOException - if an I/O error occurs during serialization
    • read

      public dev.langchain4j.data.message.ChatMessage read(ObjectInput in) throws IOException, ClassNotFoundException
      Deserializes a ChatMessage object from the specified input stream.
      Specified by:
      read in interface Serializer<dev.langchain4j.data.message.ChatMessage>
      Parameters:
      in - the input stream to read the serialized object from
      Returns:
      the deserialized ChatMessage object
      Throws:
      IOException - if an I/O error occurs during deserialization
      ClassNotFoundException - if the class of a serialized object cannot be found