Send feedback
  
   
 
  
    
      Class FutureWrapper<K,V> (2.0.0) 
  
  
  
   
  
    
  
  
    
    
    
    
    
    
    
    
    
      
  
  
  
    
public   abstract   class  FutureWrapper<K , V >  implements   Future<V>  
  FutureWrapper is a simple Future  that wraps a
 parent Future.  This class is thread-safe.
    
      
        Type Parameters  
      
        Name Description  
      
        K 
      
        V 
     
  
  Constructors
   
  FutureWrapper(Future<K> parent) 
  
    
public   FutureWrapper ( Future<K>   parent )  
  
    
      
        Parameter  
      
        Name Description  
      
        parentFuture <K > 
     
  
  Methods
   
  absorbParentException(Throwable cause) 
  
    
protected   V   absorbParentException ( Throwable   cause )  
  Override this method if you want to suppress an exception thrown by the
 parent and return a value instead.
    
      
        Returns  
      
        Type Description  
      
        V  
     
  
  
  cancel(boolean mayInterruptIfRunning) 
  
    
public   boolean   cancel ( boolean   mayInterruptIfRunning )  
  
    
      
        Parameter  
      
        Name Description  
      
        mayInterruptIfRunningboolean  
     
  
  
  convertException(Throwable cause) 
  
    
protected   abstract   Throwable   convertException ( Throwable   cause )  
  
  
  equals(@Nullable Object obj) 
  
    
public   final   boolean   equals ( @Nullable   Object   obj )  
  
  
  Overrides 
  
  get() 
  
  
    
      
        Returns  
      
        Type Description  
      
        V  
     
  
  
  get(long timeout, TimeUnit unit) 
  
    
public   V   get ( long   timeout ,   TimeUnit   unit )  
  
  
    
      
        Returns  
      
        Type Description  
      
        V  
     
  
  
  hashCode() 
  
    
public   final   int   hashCode ()  
  
    
      
        Returns  
      
        Type Description  
      
        int  
     
  
  Overrides 
  
  isCancelled() 
  
    
public   boolean   isCancelled ()  
  
  isDone() 
  
  
  wrap(@Nullable K key) 
  
    
protected   abstract   V   wrap ( @Nullable   K   key )  
  
    
      
        Parameter  
      
        Name Description  
      
        key@org.jspecify.annotations.Nullable K  
     
  
  
    
      
        Returns  
      
        Type Description  
      
        V  
     
  
  
 
     
    
  
  
  
     
  
    
    
      
       
         
  
  
    
    Send feedback
  
   
 
       
    
    
  
  
 
  Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
  Last updated 2025-10-16 UTC.
 
 
  
  
    
    
    
      
  
  
    Need to tell us more?
  
   
 
     
  
  
    
      [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-16 UTC."],[],[]]