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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondev.langchain4j.data.message.ChatMessageread(ObjectInput in) Deserializes a ChatMessage object from the specified input stream.voidwrite(dev.langchain4j.data.message.ChatMessage object, ObjectOutput out) Serializes the given ChatMessage object to the specified output stream.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.bsc.langgraph4j.serializer.Serializer
cloneObject, mimeType, readObject, writeObject
-
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:
writein interfaceSerializer<dev.langchain4j.data.message.ChatMessage>- Parameters:
object- the ChatMessage object to serializeout- 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:
readin interfaceSerializer<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 deserializationClassNotFoundException- if the class of a serialized object cannot be found
-