Class CommitLogRevisionsTranslatorFactory

  • All Implemented Interfaces:

    public final class CommitLogRevisionsTranslatorFactory
    extends java.lang.Object
    Objectify translator for ImmutableSortedMap<DateTime, Key<CommitLogManifest>> fields.

    This translator is responsible for doing three things:

    1. Translating the data into two lists of Date and Key objects, in a manner similar to @Mapify.
    2. Inserting a key to the transaction's CommitLogManifest on save.
    3. Truncating the map to include only the last key per day for the last 30 days.

    This allows you to have a field on your model object that tracks historical revisions of itself, which can be binary searched for point-in-time restoration.

    Warning: Fields of this type must not be null, or else new entries can't be inserted. You must take care to initialize the field to empty.

    See Also:
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.googlecode.objectify.impl.translate.Translator<<K,​V>> create​(com.googlecode.objectify.impl.Path path, com.googlecode.objectify.impl.Property property, java.lang.reflect.Type type, com.googlecode.objectify.impl.translate.CreateContext ctx)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CommitLogRevisionsTranslatorFactory

        public CommitLogRevisionsTranslatorFactory()
    • Method Detail

      • create

        public final com.googlecode.objectify.impl.translate.Translator<<K,​V>> create​(com.googlecode.objectify.impl.Path path,
                                                                                                                                        com.googlecode.objectify.impl.Property property,
                                                                                                                                        java.lang.reflect.Type type,
                                                                                                                                        com.googlecode.objectify.impl.translate.CreateContext ctx)
        Specified by:
        create in interface com.googlecode.objectify.impl.translate.TranslatorFactory<K extends java.lang.Comparable<? super K>>