Class ByteArrayTranslatorFactory
java.lang.Object
com.googlecode.objectify.impl.translate.ValueTranslatorFactory<byte[],Object>
com.googlecode.objectify.impl.translate.ByteArrayTranslatorFactory
- All Implemented Interfaces:
TranslatorFactory<byte[],Object>
public class ByteArrayTranslatorFactory extends ValueTranslatorFactory<byte[],Object>
Translates a byte[] to Blob. Make sure this translator gets registered *before* the normal ArrayTranslator otherwise it won't get used.
Also reads ShortBlob into the byte[]
- Author:
- Jeff Schnitzer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected ValueTranslator<byte[],Object>
createValueTranslator(TypeKey<byte[]> tk, CreateContext ctx, Path path)
Create a translator, knowing that we have the appropriate type.static byte[]
getBytesFromBlob(Object node)
Methods inherited from class com.googlecode.objectify.impl.translate.ValueTranslatorFactory
create
-
Constructor Details
-
ByteArrayTranslatorFactory
protected ByteArrayTranslatorFactory()
-
-
Method Details
-
createValueTranslator
protected ValueTranslator<byte[],Object> createValueTranslator(TypeKey<byte[]> tk, CreateContext ctx, Path path)Description copied from class:ValueTranslatorFactory
Create a translator, knowing that we have the appropriate type. You don't need to check for type matching.- Specified by:
createValueTranslator
in classValueTranslatorFactory<byte[],Object>
- Parameters:
tk
- type is guaranteed to erase to something assignable to Class
-
getBytesFromBlob
-