Class EmbeddedMapTranslatorFactory

java.lang.Object
com.googlecode.objectify.impl.translate.EmbeddedMapTranslatorFactory
All Implemented Interfaces:
TranslatorFactory<Map<Object,​Object>,​com.google.appengine.api.datastore.EmbeddedEntity>

public class EmbeddedMapTranslatorFactory
extends Object
implements TranslatorFactory<Map<Object,​Object>,​com.google.appengine.api.datastore.EmbeddedEntity>

Translator which turns a Map<String, ?> into an EmbeddedEntity. As keys in EmbeddedEntity, the map keys must be String or something that can be converted to/from String via a Stringifier. The value can be any normal translated value.

This automatically stringifies Enums and objectify Key<?>s

Author:
Jeff Schnitzer
  • Constructor Details

    • EmbeddedMapTranslatorFactory

      public EmbeddedMapTranslatorFactory()
  • Method Details

    • create

      public Translator<Map<Object,​Object>,​com.google.appengine.api.datastore.EmbeddedEntity> create(TypeKey<Map<Object,​Object>> tk, CreateContext ctx, Path path)
      Description copied from interface: TranslatorFactory
      Create a translator for a type.
      Specified by:
      create in interface TranslatorFactory<Map<Object,​Object>,​com.google.appengine.api.datastore.EmbeddedEntity>
      Parameters:
      tk - defines the type which is to be translated
      path - is where this type was discovered, important for logging and exceptions
      Returns:
      null if this factory does not know how to deal with that situation.