Package org.springframework.pulsar.core
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
Modifier and TypeInterfaceDescriptionstatic class
Reader implementation for reading objects from JSON using a customObjectMapper
.static class
Writer implementation for writing objects as JSON using a customObjectMapper
. -
Method Summary
Modifier and TypeMethodDescriptionstatic <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 representsobjectMapper
- 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 representsobjectMapper
- the mapper used to read and write objects from JSONschemaDefinitionBuilderCustomizer
- the schema definition builder customizer- Returns:
- the schema instance
-