Class LeaseOptions (5.0.3)
Stay organized with collections
Save and categorize content based on your preferences.
public final class LeaseOptions
Contains various options for lease requests following the builder pattern. Calls to LeaseOptions methods may be chained to specify multiple options in the one LeaseOptions
object.
Notes on usage:
The recommended way to instantiate a LeaseOptions object is to statically import Builder.* and invoke a static creation method followed by instance mutators:
import static com.google.appengine.api.taskqueue.LeaseOptions.Builder.*;
...
tasks = pullQueue.leaseTasks(withLeasePeriod(2, TimeUnit.HOURS).countLimit(1000));
Inheritance
Object >
LeaseOptions
Constructors
LeaseOptions(LeaseOptions options)
public LeaseOptions(LeaseOptions options)
Methods
countLimit(long countLimit)
public LeaseOptions countLimit(long countLimit)
Sets the count limit for lease requests. Must be positive.
| Parameter |
| Name |
Description |
countLimit |
long
|
deadlineInSeconds(@Nullable Double deadlineInSeconds)
public LeaseOptions deadlineInSeconds(@Nullable Double deadlineInSeconds)
Sets the deadline for lease requests. Must be positive.
equals(Object obj)
public boolean equals(Object obj)
| Parameter |
| Name |
Description |
obj |
Object
|
Overrides
groupByTag()
public LeaseOptions groupByTag()
Indicates that all tasks being leased must have the same tag. Redundant if tag is specified.
hashCode()
| Returns |
| Type |
Description |
int |
|
Overrides
leasePeriod(long lease, TimeUnit unit)
public LeaseOptions leasePeriod(long lease, TimeUnit unit)
Sets the lease period for lease requests. Must be positive.
tag(byte[] tag)
public LeaseOptions tag(byte[] tag)
Sets the tag for lease requests. Must not be null.
| Parameter |
| Name |
Description |
tag |
byte[]
|
tag(String tag)
public LeaseOptions tag(String tag)
Sets the tag for lease requests. Must not be null.
| Parameter |
| Name |
Description |
tag |
String
|
toString()
| Returns |
| Type |
Description |
String |
|
Overrides
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 2026-06-03 UTC.
[null,null,["Last updated 2026-06-03 UTC."],[],[]]