Class ProtobufBlobConverter

java.lang.Object
com.here.platform.data.client.converters.ProtobufBlobConverter
All Implemented Interfaces:
BlobConverter<String>, BlobDecoder<String>, BlobEncoder<String>, Serializable

public class ProtobufBlobConverter extends Object implements BlobConverter<String>
Encodes and decodes Protocol buffers to and from JSON strings. param: partitionDescriptorHolder holds the Protocol buffer schema descriptor.
See Also:
  • Constructor Details

  • Method Details

    • apply

      public static ProtobufBlobConverter apply(PartitionDescriptorHolder descriptorHolder)
    • decode

      public String decode(byte[] bytes)
      Decodes Protocol buffer byte array to JSON string.
      Specified by:
      decode in interface BlobDecoder<String>
      Parameters:
      bytes - Protocol buffer byte array.
      Returns:
      Decoded JSON string.
    • encode

      public byte[] encode(String data)
      Encodes JSON string as Protocol buffer Blob.
      Specified by:
      encode in interface BlobEncoder<String>
      Parameters:
      data - JSON string to encode.
      Returns:
      Protocol buffer Blob.