类 Json
java.lang.Object
dev.langchain4j.internal.Json
A utility class for JSON.
-
嵌套类概要
嵌套类 -
方法概要
修饰符和类型方法说明static <T> TConvert the given JSON string to an object of the given type.static InputStreamtoInputStream(Object o, Class<?> type) Convert the given object to anInputStream.static StringConvert the given object to JSON.
-
方法详细资料
-
toJson
Convert the given object to JSON.- 参数:
o- the object to convert.- 返回:
- the JSON string.
-
fromJson
Convert the given JSON string to an object of the given type.- 类型参数:
T- the type of the object.- 参数:
json- the JSON string.type- the type of the object.- 返回:
- the object.
-
toInputStream
Convert the given object to anInputStream.- 参数:
o- the object to convert.type- the type of the object.- 返回:
- the
InputStream. - 抛出:
IOException- if an I/O error occurs.
-