public final class SchemaUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
convertKeyValueDataStringToSchemaInfoSchema(byte[] keyValueSchemaInfoDataJsonBytes)
convert the key/value schema info data json bytes to key/value schema info data bytes
|
static String |
convertKeyValueSchemaInfoDataToString(KeyValue<SchemaInfo,SchemaInfo> kvSchemaInfo)
convert the key/value schema info data to string
|
static Map<String,String> |
deserializeSchemaProperties(String serializedProperties)
Deserialize schema properties from a serialized schema properties.
|
static String |
getStringSchemaVersion(byte[] schemaVersionBytes) |
static String |
jsonifyKeyValueSchemaInfo(KeyValue<SchemaInfo,SchemaInfo> kvSchemaInfo)
Jsonify the key/value schema info.
|
static String |
jsonifySchemaInfo(SchemaInfo schemaInfo)
Jsonify the schema info.
|
static String |
jsonifySchemaInfoWithVersion(SchemaInfoWithVersion schemaInfoWithVersion)
Jsonify the schema info with verison.
|
static String |
serializeSchemaProperties(Map<String,String> properties)
Serialize schema properties
|
static Object |
toAvroObject(Object value) |
static com.google.gson.JsonObject |
toJsonObject(String json) |
static void |
validateFieldSchema(String name,
SchemaType type,
Object val) |
public static void validateFieldSchema(String name, SchemaType type, Object val)
public static String getStringSchemaVersion(byte[] schemaVersionBytes)
public static String jsonifySchemaInfo(SchemaInfo schemaInfo)
schemaInfo - the schema infopublic static String jsonifySchemaInfoWithVersion(SchemaInfoWithVersion schemaInfoWithVersion)
schemaInfoWithVersion - the schema infopublic static com.google.gson.JsonObject toJsonObject(String json)
public static String jsonifyKeyValueSchemaInfo(KeyValue<SchemaInfo,SchemaInfo> kvSchemaInfo)
kvSchemaInfo - the key/value schema infopublic static String convertKeyValueSchemaInfoDataToString(KeyValue<SchemaInfo,SchemaInfo> kvSchemaInfo) throws IOException
kvSchemaInfo - the key/value schema infoIOExceptionpublic static byte[] convertKeyValueDataStringToSchemaInfoSchema(byte[] keyValueSchemaInfoDataJsonBytes)
throws IOException
keyValueSchemaInfoDataJsonBytes - the key/value schema info data json bytesIOExceptionpublic static String serializeSchemaProperties(Map<String,String> properties)
properties - schema propertiesCopyright © 2017–2020 Apache Software Foundation. All rights reserved.