Class KeyValueSchemaInfo
- java.lang.Object
-
- org.apache.pulsar.client.impl.schema.KeyValueSchemaInfo
-
public final class KeyValueSchemaInfo extends java.lang.ObjectUtil class for processing key/value schema info.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.apache.pulsar.common.schema.KeyValueEncodingTypedecodeKeyValueEncodingType(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.SchemaInfoencodeKeyValueSchemaInfo(java.lang.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.SchemaInfoencodeKeyValueSchemaInfo(java.lang.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.SchemaInfoencodeKeyValueSchemaInfo(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.
-
-
-
Method Detail
-
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 schemavalueSchema- the value schemakeyValueEncodingType- 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(java.lang.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 namekeySchema- the key schemavalueSchema- the value schemakeyValueEncodingType- 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(java.lang.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 namekeySchemaInfo- the key schema infovalueSchemaInfo- the value schema infokeyValueEncodingType- 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
-
-