com.google.appengine.api.datastore.Cursor_CustomFieldSerializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of objectify-gwt Show documentation
Show all versions of objectify-gwt Show documentation
Use Google App Engine datastore and Objectify classes with GWT
The newest version!
package com.google.appengine.api.datastore;
import com.google.gwt.user.client.rpc.CustomFieldSerializer;
import com.google.gwt.user.client.rpc.SerializationException;
import com.google.gwt.user.client.rpc.SerializationStreamReader;
import com.google.gwt.user.client.rpc.SerializationStreamWriter;
/**
* Custom field serializer for the datastore Cursor class
*/
public class Cursor_CustomFieldSerializer extends CustomFieldSerializer
{
public static void deserialize(SerializationStreamReader streamReader, Cursor instance) {
}
public static Cursor instantiate(SerializationStreamReader streamReader) throws SerializationException {
return Cursor.fromWebSafeString(streamReader.readString());
}
public static void serialize(SerializationStreamWriter streamWriter, Cursor instance) throws SerializationException {
streamWriter.writeString(instance.toWebSafeString());
}
@Override
public Cursor instantiateInstance(SerializationStreamReader streamReader) throws SerializationException {
return instantiate(streamReader);
}
@Override
public boolean hasCustomInstantiateInstance() {
return true;
}
@Override
public void deserializeInstance(SerializationStreamReader streamReader, Cursor instance) throws SerializationException {
deserialize(streamReader, instance);
}
@Override
public void serializeInstance(SerializationStreamWriter streamWriter, Cursor instance) throws SerializationException {
serialize(streamWriter, instance);
}
}