# 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, Frontmatter, LiveRequest, LlmRequest, LlmResponse, McpToolset.McpToolsetConfig, RunEvalResult, Session, SessionKey, ToolConfirmation`

public abstract class JsonBaseModel extends Object
The base class for the types that needs JSON serialization/deserialization capability.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `JsonBaseModel()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `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.
  `static <T extends JsonBaseModel>
  T`
  `fromJsonString(String jsonString, Class<T> clazz)`
  Deserializes a Json string to an object of the given type.
  `static com.fasterxml.jackson.databind.ObjectMapper`
  `getMapper()`
  Returns the mutable ObjectMapper instance used by ADK.
  `String`
  `toJson()`
  Serializes this object (i.e., the ObjectMappper instance used by ADK) to a Json string.
  `protected static com.fasterxml.jackson.databind.JsonNode`
  `toJsonNode(Object object)`
  Serializes an object to a JsonNode.
  `static String`
  `toJsonString(Object object)`
  Serializes an object to a Json string.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### JsonBaseModel

    public JsonBaseModel()

- ## Method Details

  - ### toJsonString

    public static String toJsonString(Object object)
    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

    public String toJson()
    Serializes this object (i.e., the ObjectMappper instance used by ADK) to a Json string.

  - ### toJsonNode

    protected static com.fasterxml.jackson.databind.JsonNode toJsonNode(Object object)
    Serializes an object to a JsonNode.

  - ### fromJsonString

    public static <T extends JsonBaseModel> T fromJsonString(String jsonString, Class<T> clazz)
    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.