@Internal public final class PulsarSchema<T> extends Object implements Serializable
Schema
, make it serializable and can be created from SchemaInfo
.
General pulsar schema info (avro, json, protobuf and keyvalue) don't contain the required class info. We have to urge users to provide the related type class and encode it into schema info.
Constructor and Description |
---|
PulsarSchema(org.apache.pulsar.client.api.Schema<org.apache.pulsar.common.schema.KeyValue<K,V>> kvSchema,
Class<K> keyClass,
Class<V> valueClass)
Create serializable pulsar schema for key value type.
|
PulsarSchema(org.apache.pulsar.client.api.Schema<T> schema)
Create serializable pulsar schema for primitive types.
|
PulsarSchema(org.apache.pulsar.client.api.Schema<T> schema,
Class<T> typeClass)
Create serializable pulsar schema for struct type or primitive types.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
org.apache.pulsar.client.api.Schema<T> |
getPulsarSchema() |
Class<T> |
getRecordClass() |
org.apache.pulsar.common.schema.SchemaInfo |
getSchemaInfo() |
int |
hashCode() |
String |
toString() |
public PulsarSchema(org.apache.pulsar.client.api.Schema<T> schema)
public PulsarSchema(org.apache.pulsar.client.api.Schema<T> schema, Class<T> typeClass)
schema
- The schema instance.typeClass
- The type class of this schema.public org.apache.pulsar.client.api.Schema<T> getPulsarSchema()
public org.apache.pulsar.common.schema.SchemaInfo getSchemaInfo()
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.