Class JsonReader<T>

java.lang.Object
io.micronaut.pulsar.schemas.json.JsonReader<T>
Type Parameters:
T - POJO type to process.
All Implemented Interfaces:
org.apache.pulsar.client.api.schema.SchemaReader<T>

public final class JsonReader<T> extends Object implements org.apache.pulsar.client.api.schema.SchemaReader<T>
JSON Schema Reader to allow using JsonMapper from Micronaut instead of shaded one in Pulsar library.
Since:
1.0
Author:
Haris Secic
  • Constructor Summary

    Constructors
    Constructor
    Description
    JsonReader(io.micronaut.json.JsonMapper jsonMapper, Class<T> pojo)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    read(byte[] bytes, int offset, int length)
     
    read(InputStream inputStream)
     

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface org.apache.pulsar.client.api.schema.SchemaReader

    getNativeSchema, read, read, read, setSchemaInfoProvider
  • Constructor Details

    • JsonReader

      public JsonReader(io.micronaut.json.JsonMapper jsonMapper, Class<T> pojo)
      Parameters:
      jsonMapper - The json mapper to use for reading
      pojo - The pojo type to read
      Since:
      1.1.0
  • Method Details

    • read

      public T read(byte[] bytes, int offset, int length)
      Specified by:
      read in interface org.apache.pulsar.client.api.schema.SchemaReader<T>
    • read

      public T read(InputStream inputStream)
      Specified by:
      read in interface org.apache.pulsar.client.api.schema.SchemaReader<T>