org.apache.shindig.common.util
Class ImmediateFuture

java.lang.Object
  extended by org.apache.shindig.common.util.ImmediateFuture

public final class ImmediateFuture
extends Object

Implements a future that is immediately available.


Method Summary
static
<T> Future<T>
errorInstance(Throwable error)
          Returns a future instance that produces an error.
static
<T> Future<T>
newInstance(T value)
          Returns a future instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newInstance

public static <T> Future<T> newInstance(T value)
Returns a future instance.

Parameters:
value - the value, which may be null.
Returns:
the future

errorInstance

public static <T> Future<T> errorInstance(Throwable error)
Returns a future instance that produces an error.

Parameters:
error - the exception that should be wrapped in an ExecutionException when {link #get()} is called.
Returns:
the future


Copyright © 2007-2012. All Rights Reserved.