类 MappedObject

java.lang.Object
cn.taketoday.buildpack.platform.json.MappedObject
直接已知子类:
BuilderMetadata, BuildpackLayersMetadata, BuildpackLayersMetadata.BuildpackLayerDetails, BuildpackMetadata, ContainerStatus, DockerConfigurationMetadata.DockerConfig, DockerConfigurationMetadata.DockerContext, Image, ImageArchiveManifest, ImageArchiveManifest.ManifestEntry, ImageConfig

public class MappedObject extends Object
Base class for mapped JSON objects.
从以下版本开始:
4.0
作者:
Phillip Webb
  • 字段详细资料

  • 构造器详细资料

  • 方法详细资料

    • getNode

      protected final JsonNode getNode()
      Return the source node of the mapped object.
      返回:
      the source node
    • valueAt

      protected <T> T valueAt(String expression, Class<T> type)
      Get the value at the given JSON path expression as a specific type.
      类型参数:
      T - the data type
      参数:
      expression - the JSON path expression
      type - the desired type. May be a simple JSON type or an interface
      返回:
      the value
    • getRoot

      protected static <T extends MappedObject> T getRoot(Object proxy)
    • valueAt

      protected static <T> T valueAt(Object proxy, String expression, Class<T> type)
    • valueAt

      private static <T> T valueAt(MappedObject root, JsonNode node, MethodHandles.Lookup lookup, String expression, Class<T> type)
    • of

      protected static <T extends MappedObject> T of(String content, Function<JsonNode,T> factory) throws IOException
      Factory method to create a new MappedObject instance.
      类型参数:
      T - the mapped object type
      参数:
      content - the JSON content for the object
      factory - a factory to create the mapped object from a JsonNode
      返回:
      the mapped object
      抛出:
      IOException - on IO error
    • of

      protected static <T extends MappedObject> T of(InputStream content, Function<JsonNode,T> factory) throws IOException
      Factory method to create a new MappedObject instance.
      类型参数:
      T - the mapped object type
      参数:
      content - the JSON content for the object
      factory - a factory to create the mapped object from a JsonNode
      返回:
      the mapped object
      抛出:
      IOException - on IO error
    • of

      protected static <T extends MappedObject, C> T of(C content, MappedObject.ContentReader<C> reader, Function<JsonNode,T> factory) throws IOException
      Factory method to create a new MappedObject instance.
      类型参数:
      T - the mapped object type
      C - the content type
      参数:
      content - the JSON content for the object
      reader - the content reader
      factory - a factory to create the mapped object from a JsonNode
      返回:
      the mapped object
      抛出:
      IOException - on IO error