Package dev.langchain4j.internal
Class Json
java.lang.Object
dev.langchain4j.internal.Json
Deprecated.
use Jackson's ObjectMapper
A utility class for JSON.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceDeprecated.The abstract JSON codec interface. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TDeprecated.use Jackson's ObjectMapperstatic InputStreamtoInputStream(Object o, Class<?> type) Deprecated.use Jackson's ObjectMapperstatic StringDeprecated.use Jackson's ObjectMapper
-
Method Details
-
toJson
Deprecated.use Jackson's ObjectMapperConvert the given object to JSON.- Parameters:
o- the object to convert.- Returns:
- the JSON string.
-
fromJson
Deprecated.use Jackson's ObjectMapperConvert the given JSON string to an object of the given type.- Type Parameters:
T- the type of the object.- Parameters:
json- the JSON string.type- the type of the object.- Returns:
- the object.
-
toInputStream
Deprecated.use Jackson's ObjectMapperConvert the given object to anInputStream.- Parameters:
o- the object to convert.type- the type of the object.- Returns:
- the
InputStream. - Throws:
IOException- if an I/O error occurs.
-