Class KeyValueSchemaInfo

java.lang.Object
org.apache.pulsar.client.impl.schema.KeyValueSchemaInfo

public final class KeyValueSchemaInfo extends Object
Util class for processing key/value schema info.
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.pulsar.common.schema.KeyValueEncodingType
    decodeKeyValueEncodingType(org.apache.pulsar.common.schema.SchemaInfo schemaInfo)
    Decode the kv encoding type from the schema info.
    static org.apache.pulsar.common.schema.KeyValue<org.apache.pulsar.common.schema.SchemaInfo,org.apache.pulsar.common.schema.SchemaInfo>
    decodeKeyValueSchemaInfo(org.apache.pulsar.common.schema.SchemaInfo schemaInfo)
    Decode the key/value schema info to get key schema info and value schema info.
    static <K, V> org.apache.pulsar.common.schema.SchemaInfo
    encodeKeyValueSchemaInfo(String schemaName, org.apache.pulsar.client.api.Schema<K> keySchema, org.apache.pulsar.client.api.Schema<V> valueSchema, org.apache.pulsar.common.schema.KeyValueEncodingType keyValueEncodingType)
    Encode key & value into schema into a KeyValue schema.
    static org.apache.pulsar.common.schema.SchemaInfo
    encodeKeyValueSchemaInfo(String schemaName, org.apache.pulsar.common.schema.SchemaInfo keySchemaInfo, org.apache.pulsar.common.schema.SchemaInfo valueSchemaInfo, org.apache.pulsar.common.schema.KeyValueEncodingType keyValueEncodingType)
    Encode key & value into schema into a KeyValue schema.
    static <K, V> org.apache.pulsar.common.schema.SchemaInfo
    encodeKeyValueSchemaInfo(org.apache.pulsar.client.api.Schema<K> keySchema, org.apache.pulsar.client.api.Schema<V> valueSchema, org.apache.pulsar.common.schema.KeyValueEncodingType keyValueEncodingType)
    Encode key & value into schema into a KeyValue schema.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • decodeKeyValueEncodingType

      public static org.apache.pulsar.common.schema.KeyValueEncodingType decodeKeyValueEncodingType(org.apache.pulsar.common.schema.SchemaInfo schemaInfo)
      Decode the kv encoding type from the schema info.
      Parameters:
      schemaInfo - the schema info
      Returns:
      the kv encoding type
    • encodeKeyValueSchemaInfo

      public static <K, V> org.apache.pulsar.common.schema.SchemaInfo encodeKeyValueSchemaInfo(org.apache.pulsar.client.api.Schema<K> keySchema, org.apache.pulsar.client.api.Schema<V> valueSchema, org.apache.pulsar.common.schema.KeyValueEncodingType keyValueEncodingType)
      Encode key & value into schema into a KeyValue schema.
      Parameters:
      keySchema - the key schema
      valueSchema - the value schema
      keyValueEncodingType - the encoding type to encode and decode key value pair
      Returns:
      the final schema info
    • encodeKeyValueSchemaInfo

      public static <K, V> org.apache.pulsar.common.schema.SchemaInfo encodeKeyValueSchemaInfo(String schemaName, org.apache.pulsar.client.api.Schema<K> keySchema, org.apache.pulsar.client.api.Schema<V> valueSchema, org.apache.pulsar.common.schema.KeyValueEncodingType keyValueEncodingType)
      Encode key & value into schema into a KeyValue schema.
      Parameters:
      schemaName - the final schema name
      keySchema - the key schema
      valueSchema - the value schema
      keyValueEncodingType - the encoding type to encode and decode key value pair
      Returns:
      the final schema info
    • encodeKeyValueSchemaInfo

      public static org.apache.pulsar.common.schema.SchemaInfo encodeKeyValueSchemaInfo(String schemaName, org.apache.pulsar.common.schema.SchemaInfo keySchemaInfo, org.apache.pulsar.common.schema.SchemaInfo valueSchemaInfo, org.apache.pulsar.common.schema.KeyValueEncodingType keyValueEncodingType)
      Encode key & value into schema into a KeyValue schema.
      Parameters:
      schemaName - the final schema name
      keySchemaInfo - the key schema info
      valueSchemaInfo - the value schema info
      keyValueEncodingType - the encoding type to encode and decode key value pair
      Returns:
      the final schema info
    • decodeKeyValueSchemaInfo

      public static org.apache.pulsar.common.schema.KeyValue<org.apache.pulsar.common.schema.SchemaInfo,org.apache.pulsar.common.schema.SchemaInfo> decodeKeyValueSchemaInfo(org.apache.pulsar.common.schema.SchemaInfo schemaInfo)
      Decode the key/value schema info to get key schema info and value schema info.
      Parameters:
      schemaInfo - key/value schema info.
      Returns:
      the pair of key schema info and value schema info