Interface ToolSpecificationJsonCodec


public interface ToolSpecificationJsonCodec
Codec for converting between an object representation of a ToolSpecification and a JSON string.

The default implementation uses a dedicated Jackson ObjectMapper. A custom implementation can be provided via SPI using ToolSpecificationJsonCodecFactory.

  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    fromJson(String json, Class<T> type)
    Deserializes a JSON string to an object of the given class.
    toJson(Object object)
    Serializes an object to a JSON string.
  • Method Details

    • toJson

      String toJson(Object object)
      Serializes an object to a JSON string.
      Parameters:
      object - the object to serialize.
      Returns:
      the JSON string.
    • fromJson

      <T> T fromJson(String json, Class<T> type)
      Deserializes a JSON string to an object of the given class.
      Type Parameters:
      T - the type of the object.
      Parameters:
      json - the JSON string to deserialize.
      type - the class of the object.
      Returns:
      the deserialized object.