Class KeyValueSchemaInfo
java.lang.Object
org.apache.pulsar.client.impl.schema.KeyValueSchemaInfo
Util class for processing key/value schema info.
-
Method Summary
Modifier and TypeMethodDescriptionstatic KeyValueEncodingTypedecodeKeyValueEncodingType(SchemaInfo schemaInfo) Decode the kv encoding type from the schema info.static KeyValue<SchemaInfo, SchemaInfo> decodeKeyValueSchemaInfo(SchemaInfo schemaInfo) Decode the key/value schema info to get key schema info and value schema info.static <K,V> SchemaInfo encodeKeyValueSchemaInfo(String schemaName, Schema<K> keySchema, Schema<V> valueSchema, KeyValueEncodingType keyValueEncodingType) Encode key invalid input: '&' value into schema into a KeyValue schema.static SchemaInfoencodeKeyValueSchemaInfo(String schemaName, SchemaInfo keySchemaInfo, SchemaInfo valueSchemaInfo, KeyValueEncodingType keyValueEncodingType) Encode key invalid input: '&' value into schema into a KeyValue schema.static <K,V> SchemaInfo encodeKeyValueSchemaInfo(Schema<K> keySchema, Schema<V> valueSchema, KeyValueEncodingType keyValueEncodingType) Encode key invalid input: '&' value into schema into a KeyValue schema.
-
Method Details
-
decodeKeyValueEncodingType
Decode the kv encoding type from the schema info.- Parameters:
schemaInfo- the schema info- Returns:
- the kv encoding type
-
encodeKeyValueSchemaInfo
public static <K,V> SchemaInfo encodeKeyValueSchemaInfo(Schema<K> keySchema, Schema<V> valueSchema, KeyValueEncodingType keyValueEncodingType) Encode key invalid input: '&' 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> SchemaInfo encodeKeyValueSchemaInfo(String schemaName, Schema<K> keySchema, Schema<V> valueSchema, KeyValueEncodingType keyValueEncodingType) Encode key invalid input: '&' 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 SchemaInfo encodeKeyValueSchemaInfo(String schemaName, SchemaInfo keySchemaInfo, SchemaInfo valueSchemaInfo, KeyValueEncodingType keyValueEncodingType) Encode key invalid input: '&' 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
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
-