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
NameDescription
optionsLeaseOptions

Methods

countLimit(long countLimit)

public LeaseOptions countLimit(long countLimit)

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

Parameter
NameDescription
countLimitlong
Returns
TypeDescription
LeaseOptions

deadlineInSeconds(@Nullable Double deadlineInSeconds)

public LeaseOptions deadlineInSeconds(@Nullable Double deadlineInSeconds)

Sets the deadline for lease requests. Must be positive.

Parameter
NameDescription
deadlineInSeconds@org.checkerframework.checker.nullness.qual.Nullable java.lang.Double
Returns
TypeDescription
LeaseOptions

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

groupByTag()

public LeaseOptions groupByTag()

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

Returns
TypeDescription
LeaseOptions

hashCode()

public int hashCode()
Returns
TypeDescription
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
NameDescription
leaselong
unitTimeUnit
Returns
TypeDescription
LeaseOptions

tag(byte[] tag)

public LeaseOptions tag(byte[] tag)

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

Parameter
NameDescription
tagbyte[]
Returns
TypeDescription
LeaseOptions

tag(String tag)

public LeaseOptions tag(String tag)

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

Parameter
NameDescription
tagString
Returns
TypeDescription
LeaseOptions

toString()

public String toString()
Returns
TypeDescription
String
Overrides