com.appenginefan.toolkit.persistence
Class ProtocolBufferPersistence<T extends Message>

java.lang.Object
  extended by com.appenginefan.toolkit.persistence.MarshallingPersistence<T>
      extended by com.appenginefan.toolkit.persistence.ProtocolBufferPersistence<T>
Type Parameters:
T - the type of protocol message that this persistence is for
All Implemented Interfaces:
Persistence<T>

public class ProtocolBufferPersistence<T extends Message>
extends MarshallingPersistence<T>

Persistence that uses googles protocol buffer framework for efficient representation and serialization of data.


Constructor Summary
ProtocolBufferPersistence(Persistence<byte[]> backend, T prototype)
          Constructor
 
Method Summary
protected  byte[] makeArray(T nonNullValue)
           
protected  T makeType(byte[] nonNullValue)
           
 
Methods inherited from class com.appenginefan.toolkit.persistence.MarshallingPersistence
get, keyScan, keyScanReverse, mutate, scan, scanReverse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProtocolBufferPersistence

public ProtocolBufferPersistence(Persistence<byte[]> backend,
                                 T prototype)
Constructor

Parameters:
backend - a backend that stores serialized protocol buffers
prototype - a prototype instance of the generic type that this peristence object is for.
Method Detail

makeArray

protected byte[] makeArray(T nonNullValue)
Specified by:
makeArray in class MarshallingPersistence<T extends Message>

makeType

protected T makeType(byte[] nonNullValue)
Specified by:
makeType in class MarshallingPersistence<T extends Message>