Class ProtobufBlobConverter
java.lang.Object
com.here.platform.data.client.converters.ProtobufBlobConverter
- All Implemented Interfaces:
BlobConverter<String>,BlobDecoder<String>,BlobEncoder<String>,Serializable
Encodes and decodes Protocol buffers to and from JSON strings.
param: partitionDescriptorHolder holds the Protocol buffer schema descriptor.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ProtobufBlobConverterapply(PartitionDescriptorHolder descriptorHolder) decode(byte[] bytes) Decodes Protocol buffer byte array to JSON string.byte[]Encodes JSON string as Protocol buffer Blob.
-
Constructor Details
-
ProtobufBlobConverter
-
-
Method Details
-
apply
-
decode
Decodes Protocol buffer byte array to JSON string.- Specified by:
decodein interfaceBlobDecoder<String>- Parameters:
bytes- Protocol buffer byte array.- Returns:
- Decoded JSON string.
-
encode
Encodes JSON string as Protocol buffer Blob.- Specified by:
encodein interfaceBlobEncoder<String>- Parameters:
data- JSON string to encode.- Returns:
- Protocol buffer Blob.
-