Class JsonSchema<T>

java.lang.Object
org.apache.pulsar.client.impl.schema.AbstractSchema<T>
org.apache.pulsar.client.impl.schema.AbstractStructSchema<T>
org.apache.pulsar.client.impl.schema.AvroBaseStructSchema<T>
io.micronaut.pulsar.schemas.json.JsonSchema<T>
Type Parameters:
T - POJO type to send and receive via Pulsar.
All Implemented Interfaces:
Cloneable, org.apache.pulsar.client.api.Schema<T>

public class JsonSchema<T> extends org.apache.pulsar.client.impl.schema.AvroBaseStructSchema<T>
JSON Schema to allow using JsonMapper from Micronaut instead of shaded one in Pulsar library.
Since:
1.0
Author:
Haris Secic
  • Field Summary

    Fields inherited from class org.apache.pulsar.client.impl.schema.AvroBaseStructSchema

    schema

    Fields inherited from class org.apache.pulsar.client.impl.schema.AbstractStructSchema

    LOG, reader, schemaInfo, schemaInfoProvider, writer

    Fields inherited from interface org.apache.pulsar.client.api.Schema

    BOOL, BYTEBUFFER, BYTES, DATE, DOUBLE, FLOAT, INSTANT, INT16, INT32, INT64, INT8, LOCAL_DATE, LOCAL_DATE_TIME, LOCAL_TIME, STRING, TIME, TIMESTAMP
  • Constructor Summary

    Constructors
    Constructor
    Description
    JsonSchema(org.apache.pulsar.common.schema.SchemaInfo schemaInfo, org.apache.pulsar.client.api.schema.SchemaReader<T> reader, org.apache.pulsar.client.api.schema.SchemaWriter<T> writer)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> JsonSchema<T>
    of(Class<T> pojo, io.micronaut.json.JsonMapper jsonMapper)
     

    Methods inherited from class org.apache.pulsar.client.impl.schema.AvroBaseStructSchema

    getAvroSchema, getNativeSchema

    Methods inherited from class org.apache.pulsar.client.impl.schema.AbstractStructSchema

    atSchemaVersion, decode, decode, decode, decode, decode, decode, encode, getReader, getSchemaInfo, setReader, setSchemaInfoProvider, setWriter

    Methods inherited from class org.apache.pulsar.client.impl.schema.AbstractSchema

    clone

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface org.apache.pulsar.client.api.Schema

    configureSchemaInfo, requireFetchingSchemaInfo, supportSchemaVersioning, validate
  • Constructor Details

    • JsonSchema

      public JsonSchema(org.apache.pulsar.common.schema.SchemaInfo schemaInfo, org.apache.pulsar.client.api.schema.SchemaReader<T> reader, org.apache.pulsar.client.api.schema.SchemaWriter<T> writer)
  • Method Details

    • of

      public static <T> JsonSchema<T> of(Class<T> pojo, io.micronaut.json.JsonMapper jsonMapper)
      Type Parameters:
      T - The pojo class to map
      Parameters:
      pojo - The pojo class to map
      jsonMapper - The json mapper to use for mapping
      Returns:
      The parsed json schema
      Since:
      1.1.0