Package dev.langchain4j.internal
Class Json
-
- All Implemented Interfaces:
@Deprecated() public class Json
A utility class for JSON.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceJson.JsonCodecThe abstract JSON codec interface.
-
Method Summary
Modifier and Type Method Description static StringtoJson(Object o)Convert the given object to JSON. static <T> TfromJson(String json, Class<T> type)Convert the given JSON string to an object of the given class. static <T> TfromJson(String json, Type type)Convert the given JSON string to an object of the given type. static InputStreamtoInputStream(Object o, Class<out Object> type)Convert the given object to an InputStream. -
-
Method Detail
-
toJson
@Deprecated() static String toJson(Object o)
Convert the given object to JSON.
- Parameters:
o- the object to convert.- Returns:
the JSON string.
-
fromJson
@Deprecated() static <T> T fromJson(String json, Class<T> type)
Convert the given JSON string to an object of the given class.
- Parameters:
json- the JSON string.type- the class of the object.- Returns:
the object.
-
fromJson
@Deprecated() static <T> T fromJson(String json, Type type)
Convert the given JSON string to an object of the given type.
- Parameters:
json- the JSON string.type- the type of the object.- Returns:
the object.
-
toInputStream
@Deprecated() static InputStream toInputStream(Object o, Class<out Object> type)
Convert the given object to an InputStream.
- Parameters:
o- the object to convert.type- the type of the object.- Returns:
the InputStream.
-
-
-
-