com.googlecode.objectify.impl.ResultAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of objectify Show documentation
Show all versions of objectify Show documentation
*** THIS VERSION UPLOADED FOR USE WITH CEDAR-COMMON, TO AVOID DEPENDENCIES ON GOOGLE CODE-BASED MAVEN REPOSITORIES. *** The simplest convenient interface to the Google App Engine datastore
The newest version!
package com.googlecode.objectify.impl;
import java.util.concurrent.Future;
import com.googlecode.objectify.Result;
import com.googlecode.objectify.util.FutureHelper;
/**
* Adapts a Future object to a (much more convenient) Result object.
*
* @author Jeff Schnitzer
*/
public class ResultAdapter implements Result
{
/** */
Future future;
/** */
public ResultAdapter(Future fut)
{
this.future = fut;
}
@Override
public T get()
{
try
{
return this.future.get();
}
catch (Exception e)
{
FutureHelper.unwrapAndThrow(e);
return null; // make compiler happy
}
}
@Override
public Future getFuture()
{
return this.future;
}
}