Send feedback
  
   
 
  
    
      Class TaskHandle (2.0.0) 
  
  
  
   
  
    
  
  
    
    
    
    
    
    
    
    
    
      
  
  
  
    
public   final   class  TaskHandle   implements   Serializable  
  Created from Queue#add(TaskOptions) . Contains the task name (generated if otherwise
 unspecified), task ETA (computed if not specified) and queue name. The queue name and task name
 uniquely identify the task for an application.
    Inheritance 
    Object  >  
    TaskHandle 
   
  
  
  Constructors
   
  TaskHandle(TaskOptions options, String queueName) 
  
    
public   TaskHandle ( TaskOptions   options ,   String   queueName )  
  
  TaskHandle(String name, String queueName, long etaMillis) (deprecated) 
  
    
public   TaskHandle ( String   name ,   String   queueName ,   long   etaMillis )  
  
  
  Methods
   
  equals(Object obj) 
  
    
public   boolean   equals ( Object   obj )  
  
    
      
        Parameter  
      
        Name Description  
      
        objObject  
     
  
  
  Overrides 
  
  extractParams() 
  
    
public   List<Map . Entry<String , String >>  extractParams ()  
  Attempts to decode the payload byte array in our options into a list of 
 Map.Entry<String, String>.
getEtaMillis() 
  
    
public   long   getEtaMillis ()  
  Returns a time comparable to System#currentTimeMillis()  when this task is scheduled for
 execution.
    
      
        Returns  
      
        Type Description  
      
        long  
     
  
  getName() 
  
  Returns the name of this task. This may have been generated by a call to Queue#add()  if
 the name was not otherwise specified.
    
      
        Returns  
      
        Type Description  
      
        String  
     
  
  getPayload() 
  
    
public   byte []   getPayload ()  
  Returns binary payload data of this task. Can return null.
    
      
        Returns  
      
        Type Description  
      
        byte [] 
     
  
  getQueueName() 
  
    
public   String   getQueueName ()  
  Returns the name of the queue that this task was submitted into.
    
      
        Returns  
      
        Type Description  
      
        String  
     
  
  getRetryCount() 
  
    
public   Integer   getRetryCount ()  
  Returns number of leases that had been performed on this task. Can return null.
getTag() 
  
  Returns tag of this task. Can return null.
    
      
        Returns  
      
        Type Description  
      
        String  
     
  
  
  getTagAsBytes() 
  
    
public   byte []   getTagAsBytes ()  
  Returns tag of this task. Can return null.
    
      
        Returns  
      
        Type Description  
      
        byte [] 
     
  
  hashCode() 
  
  
    
      
        Returns  
      
        Type Description  
      
        int  
     
  
  Overrides 
  
  toString() 
  
  
    
      
        Returns  
      
        Type Description  
      
        String  
     
  
  Overrides 
  
 
     
    
  
  
  
     
  
    
    
      
       
         
  
  
    
    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."],[],[]]