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>
-
- org.apache.pulsar.client.impl.schema.JSONSchema<T>
-
- All Implemented Interfaces:
java.lang.Cloneable,org.apache.pulsar.client.api.Schema<T>
public class JSONSchema<T> extends AvroBaseStructSchema<T>
A schema implementation to deal with json data.
-
-
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
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.pulsar.common.schema.SchemaInfogetBackwardsCompatibleJsonSchemaInfo()Implemented for backwards compatibility reasons.static <T> JSONSchema<T>of(java.lang.Class<T> pojo)static <T> JSONSchema<T>of(java.lang.Class<T> pojo, java.util.Map<java.lang.String,java.lang.String> properties)static <T> JSONSchema<T>of(org.apache.pulsar.client.api.schema.SchemaDefinition<T> schemaDefinition)-
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, encode, getReader, getSchemaInfo, setReader, setSchemaInfoProvider, setWriter
-
Methods inherited from class org.apache.pulsar.client.impl.schema.AbstractSchema
clone
-
-
-
-
Method Detail
-
getBackwardsCompatibleJsonSchemaInfo
public org.apache.pulsar.common.schema.SchemaInfo getBackwardsCompatibleJsonSchemaInfo()
Implemented for backwards compatibility reasons. since the original schema generated by JSONSchema was based off the json schema standard since then we have standardized on Avro- Returns:
-
of
public static <T> JSONSchema<T> of(org.apache.pulsar.client.api.schema.SchemaDefinition<T> schemaDefinition)
-
of
public static <T> JSONSchema<T> of(java.lang.Class<T> pojo)
-
of
public static <T> JSONSchema<T> of(java.lang.Class<T> pojo, java.util.Map<java.lang.String,java.lang.String> properties)
-
-