Interface JSONSchemaUtil


public interface JSONSchemaUtil
Factory to create schema definition builders that provide schema definitions that use custom object mappers when de/serializing objects.
Since:
1.2.0
Author:
Chris Bono
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    Reader implementation for reading objects from JSON using a custom ObjectMapper.
    static class 
    Writer implementation for writing objects as JSON using a custom ObjectMapper.
  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    static <T> org.apache.pulsar.client.impl.schema.JSONSchema<T>
    schemaForTypeWithObjectMapper(Class<T> objectType, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
    Create a new JSON schema that uses the provided object mapper to de/serialize objects of the specified type.
    static <T> org.apache.pulsar.client.impl.schema.JSONSchema<T>
    schemaForTypeWithObjectMapper(Class<T> objectType, com.fasterxml.jackson.databind.ObjectMapper objectMapper, Consumer<org.apache.pulsar.client.api.schema.SchemaDefinitionBuilder<T>> schemaDefinitionBuilderCustomizer)
    Create a new JSON schema that uses the provided object mapper to de/serialize objects of the specified type.
  • Method Details

    • schemaForTypeWithObjectMapper

      static <T> org.apache.pulsar.client.impl.schema.JSONSchema<T> schemaForTypeWithObjectMapper(Class<T> objectType, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
      Create a new JSON schema that uses the provided object mapper to de/serialize objects of the specified type.
      Type Parameters:
      T - the type of objects the resulting schema represents
      Parameters:
      objectType - the type of objects the resulting schema represents
      objectMapper - the mapper used to read and write objects from JSON
      Returns:
      the schema instance
    • schemaForTypeWithObjectMapper

      static <T> org.apache.pulsar.client.impl.schema.JSONSchema<T> schemaForTypeWithObjectMapper(Class<T> objectType, com.fasterxml.jackson.databind.ObjectMapper objectMapper, Consumer<org.apache.pulsar.client.api.schema.SchemaDefinitionBuilder<T>> schemaDefinitionBuilderCustomizer)
      Create a new JSON schema that uses the provided object mapper to de/serialize objects of the specified type.
      Type Parameters:
      T - the type of objects the resulting schema represents
      Parameters:
      objectType - the type of objects the resulting schema represents
      objectMapper - the mapper used to read and write objects from JSON
      schemaDefinitionBuilderCustomizer - the schema definition builder customizer
      Returns:
      the schema instance