Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.infinispan.commons.util.concurrent;
 
A future that doesn't do anything and simply returns a given return value.

Author(s):
Manik Surtani
Since:
5.1
public class NoOpFuture<E> implements NotifyingNotifiableFuture<E> {
   private final E returnValue;
   public NoOpFuture(E returnValue) {
      this. = returnValue;
   }
   @Override
   public boolean cancel(boolean b) {
      return false;
   }
   @Override
   public boolean isCancelled() {
      return false;
   }
   @Override
   public boolean isDone() {
      return true;
   }
   @Override
   public E get() throws InterruptedExceptionExecutionException {
      return ;
   }
   @Override
   public E get(long lTimeUnit timeUnitthrows InterruptedExceptionExecutionExceptionTimeoutException {
      return ;
   }
   @Override
   public void notifyDone() {      
   }
   @Override
   public void setNetworkFuture(Future<E> eFuture) {
      throw new UnsupportedOperationException();
   }
   @Override
   public NotifyingFuture<E> attachListener(FutureListener<E> eFutureListener) {
      eFutureListener.futureDone(this);
      return this;
   }
New to GrepCode? Check out our FAQ X