Class SystemMessageSerializer

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

public class SystemMessageSerializer extends Object implements Serializer<dev.langchain4j.data.message.SystemMessage>
The SystemMessageSerializer class implements the Serializer interface for the SystemMessage type. It provides methods to serialize and deserialize SystemMessage objects.
  • Constructor Details

    • SystemMessageSerializer

      public SystemMessageSerializer()
  • Method Details

    • write

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

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