Class JsonBaseModel
java.lang.Object
com.google.adk.JsonBaseModel
- Direct Known Subclasses:
Event
,LiveRequest
,LlmRequest
,LlmResponse
,Session
The base class for the types that needs JSON serialization/deserialization capability.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends JsonBaseModel>
TfromJsonNode
(com.fasterxml.jackson.databind.JsonNode jsonNode, Class<T> clazz) Deserializes a JsonNode to an object of the given type.static <T extends JsonBaseModel>
TfromJsonString
(String jsonString, Class<T> clazz) Deserializes a Json string to an object of the given type.static com.fasterxml.jackson.databind.ObjectMapper
toJson()
protected static com.fasterxml.jackson.databind.JsonNode
toJsonNode
(Object object) Serializes an object to a JsonNode.protected static String
toJsonString
(Object object) Serializes an object to a Json string.
-
Constructor Details
-
JsonBaseModel
public JsonBaseModel()
-
-
Method Details
-
toJsonString
-
getMapper
public static com.fasterxml.jackson.databind.ObjectMapper getMapper() -
toJson
-
toJsonNode
Serializes an object to a JsonNode. -
fromJsonString
Deserializes a Json string to an object of the given type. -
fromJsonNode
public static <T extends JsonBaseModel> T fromJsonNode(com.fasterxml.jackson.databind.JsonNode jsonNode, Class<T> clazz) Deserializes a JsonNode to an object of the given type.
-