Class UserMessageSerializer
java.lang.Object
org.bsc.langgraph4j.langchain4j.serializer.std.UserMessageSerializer
- All Implemented Interfaces:
Serializer<dev.langchain4j.data.message.UserMessage>,NullableObjectSerializer<dev.langchain4j.data.message.UserMessage>
public class UserMessageSerializer
extends Object
implements NullableObjectSerializer<dev.langchain4j.data.message.UserMessage>
The UserMessageSerializer class implements the NullableObjectSerializer interface for the UserMessage type.
It provides methods to serialize and deserialize UserMessage objects.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondev.langchain4j.data.message.UserMessageread(ObjectInput in) Deserializes a UserMessage object from the specified ObjectInput.voidwrite(dev.langchain4j.data.message.UserMessage object, ObjectOutput out) Serializes the given UserMessage object to the specified ObjectOutput.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.std.NullableObjectSerializer
readNullableObject, readNullableUTF, writeNullableObject, writeNullableUTFMethods inherited from interface org.bsc.langgraph4j.serializer.Serializer
cloneObject, mimeType, readObject, writeObject
-
Constructor Details
-
UserMessageSerializer
public UserMessageSerializer()
-
-
Method Details
-
write
public void write(dev.langchain4j.data.message.UserMessage object, ObjectOutput out) throws IOException Serializes the given UserMessage object to the specified ObjectOutput.- Specified by:
writein interfaceSerializer<dev.langchain4j.data.message.UserMessage>- Parameters:
object- the UserMessage object to serializeout- the ObjectOutput to write the serialized data to- Throws:
IOException- if an I/O error occurs during serializationIllegalArgumentException- if the content type of the UserMessage is unsupported
-
read
public dev.langchain4j.data.message.UserMessage read(ObjectInput in) throws IOException, ClassNotFoundException Deserializes a UserMessage object from the specified ObjectInput.- Specified by:
readin interfaceSerializer<dev.langchain4j.data.message.UserMessage>- Parameters:
in- the ObjectInput to read the serialized data from- Returns:
- the deserialized UserMessage object
- Throws:
IOException- if an I/O error occurs during deserializationClassNotFoundException- if the class of a serialized object cannot be found
-