Class LeaseOptions (2.0.0)

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)

A copy constructor for LeaseOptions.

Parameter
Name Description
options LeaseOptions

Methods

countLimit(long countLimit)

public LeaseOptions countLimit(long countLimit)

Sets the count limit for lease requests. Must be positive.

Parameter
Name Description
countLimit long
Returns
Type Description
LeaseOptions

deadlineInSeconds(@Nullable Double deadlineInSeconds)

public LeaseOptions deadlineInSeconds(@Nullable Double deadlineInSeconds)

Sets the deadline for lease requests. Must be positive.

Parameter
Name Description
deadlineInSeconds @org.checkerframework.checker.nullness.qual.Nullable java.lang.Double
Returns
Type Description
LeaseOptions

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

groupByTag()

public LeaseOptions groupByTag()

Indicates that all tasks being leased must have the same tag. Redundant if tag is specified.

Returns
Type Description
LeaseOptions

hashCode()

public int 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.

Parameters
Name Description
lease long
unit TimeUnit
Returns
Type Description
LeaseOptions

tag(byte[] tag)

public LeaseOptions tag(byte[] tag)

Sets the tag for lease requests. Must not be null.

Parameter
Name Description
tag byte[]
Returns
Type Description
LeaseOptions

tag(String tag)

public LeaseOptions tag(String tag)

Sets the tag for lease requests. Must not be null.

Parameter
Name Description
tag String
Returns
Type Description
LeaseOptions

toString()

public String toString()
Returns
Type Description
String
Overrides