Package com.google.adk
Class JsonBaseModel
java.lang.Object
com.google.adk.JsonBaseModel
- Direct Known Subclasses:
BaseCodeExecutor,BaseTool.ToolArgsConfig,BaseTool.ToolConfig,CodeExecutionUtils.CodeExecutionInput,CodeExecutionUtils.CodeExecutionResult,CodeExecutionUtils.File,Event,EventActions,Example,LiveRequest,LlmRequest,LlmResponse,McpToolset.McpToolsetConfig,Session,SessionKey,ToolConfirmation
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.ObjectMapperReturns the mutable ObjectMapper instance used by ADK.toJson()Serializes this object (i.e., the ObjectMappper instance used by ADK) to a Json string.protected static com.fasterxml.jackson.databind.JsonNodetoJsonNode(Object object) Serializes an object to a JsonNode.static StringtoJsonString(Object object) Serializes an object to a Json string.
-
Constructor Details
-
JsonBaseModel
public JsonBaseModel()
-
-
Method Details
-
toJsonString
Serializes an object to a Json string. -
getMapper
public static com.fasterxml.jackson.databind.ObjectMapper getMapper()Returns the mutable ObjectMapper instance used by ADK. -
toJson
Serializes this object (i.e., the ObjectMappper instance used by ADK) to a Json string. -
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.
-