public class ProtobufSerializer extends Object implements GlueSchemaRegistryDataFormatSerializer
| Modifier and Type | Field and Description |
|---|---|
protected @NonNull com.google.common.cache.LoadingCache<com.google.protobuf.DescriptorProtos.FileDescriptorProto,String> |
schemaGeneratorCache |
| Constructor and Description |
|---|
ProtobufSerializer(GlueSchemaRegistryConfiguration configs)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
String |
getSchemaDefinition(@NonNull Object object)
Get the schema definition.
|
byte[] |
serialize(@NonNull Object data)
Serialize the Protobuf object to bytes
|
void |
validate(@NonNull Object object) |
void |
validate(@NonNull String schemaDefinition,
@NonNull byte[] data) |
@NonNull protected final @NonNull com.google.common.cache.LoadingCache<com.google.protobuf.DescriptorProtos.FileDescriptorProto,String> schemaGeneratorCache
public ProtobufSerializer(GlueSchemaRegistryConfiguration configs)
configs - configuration elementspublic byte[] serialize(@NonNull
@NonNull Object data)
serialize in interface GlueSchemaRegistryDataFormatSerializerdata - the Protobuf object for serializationAWSSchemaRegistryException - AWS Schema Registry Exceptionpublic String getSchemaDefinition(@NonNull @NonNull Object object)
getSchemaDefinition in interface GlueSchemaRegistryDataFormatSerializerobject - object for which schema definition has to be derivedpublic void validate(@NonNull
@NonNull String schemaDefinition,
@NonNull
@NonNull byte[] data)
validate in interface GlueSchemaRegistryDataFormatSerializerpublic void validate(@NonNull
@NonNull Object object)
validate in interface GlueSchemaRegistryDataFormatSerializerCopyright © 2024. All rights reserved.