Class ByteArrayTranslatorFactory

  • All Implemented Interfaces:
    TranslatorFactory<byte[],​com.google.cloud.datastore.Blob>

    public class ByteArrayTranslatorFactory
    extends SimpleTranslatorFactory<byte[],​com.google.cloud.datastore.Blob>

    Translates a byte[] to Blob. Make sure this translator gets registered *before* the normal ArrayTranslator otherwise it won't get used.

    Author:
    Jeff Schnitzer
    • Constructor Detail

      • ByteArrayTranslatorFactory

        protected ByteArrayTranslatorFactory()
    • Method Detail

      • toPojo

        protected byte[] toPojo​(com.google.cloud.datastore.Value<com.google.cloud.datastore.Blob> value)
        Specified by:
        toPojo in class SimpleTranslatorFactory<byte[],​com.google.cloud.datastore.Blob>
      • toDatastore

        protected com.google.cloud.datastore.Value<com.google.cloud.datastore.Blob> toDatastore​(byte[] value)
        Specified by:
        toDatastore in class SimpleTranslatorFactory<byte[],​com.google.cloud.datastore.Blob>