com.google.appengine.api.taskqueue

## Class LeaseOptions

- java.lang.Object
- - com.google.appengine.api.taskqueue.LeaseOptions

-     public final class LeaseOptions
      extends java.lang.Object

  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 `LeaseOptions.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));

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `LeaseOptions.Builder` Provides static creation methods for `LeaseOptions`.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LeaseOptions(LeaseOptions options)` A copy constructor for `LeaseOptions`.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `LeaseOptions` | `countLimit(long countLimit)` Sets the count limit for lease requests.
    `LeaseOptions` | `deadlineInSeconds(java.lang.Double deadlineInSeconds)` Sets the deadline for lease requests.
    `boolean` | `equals(java.lang.Object obj)`
    `LeaseOptions` | `groupByTag()` Indicates that all tasks being leased must have the same tag.
    `int` | `hashCode()`
    `LeaseOptions` | `leasePeriod(long lease, java.util.concurrent.TimeUnit unit)` Sets the lease period for lease requests.
    `LeaseOptions` | `tag(byte[] tag)` Sets the tag for lease requests.
    `LeaseOptions` | `tag(java.lang.String tag)` Sets the tag for lease requests.
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### LeaseOptions

          public LeaseOptions(LeaseOptions options)

      A copy constructor for `LeaseOptions`.

  - ### Method Detail

    - #### leasePeriod

          public LeaseOptions leasePeriod(long lease,
                                 java.util.concurrent.TimeUnit unit)

      Sets the lease period for lease requests. Must be positive.
      Throws:
        `java.lang.IllegalArgumentException`

    - #### countLimit

          public LeaseOptions countLimit(long countLimit)

      Sets the count limit for lease requests. Must be positive.
      Throws:
        `java.lang.IllegalArgumentException`

    - #### deadlineInSeconds

          public LeaseOptions deadlineInSeconds(java.lang.Double deadlineInSeconds)

      Sets the deadline for lease requests. Must be positive.
      Throws:
        `java.lang.IllegalArgumentException`

    - #### groupByTag

          public LeaseOptions groupByTag()

      Indicates that all tasks being leased must have the same tag. Redundant if tag is specified.
      Throws:
        `java.lang.IllegalArgumentException`

    - #### tag

          public LeaseOptions tag(byte[] tag)

      Sets the tag for lease requests. Must not be null.
      Throws:
        `java.lang.IllegalArgumentException`

    - #### tag

          public LeaseOptions tag(java.lang.String tag)

      Sets the tag for lease requests. Must not be null.
      Throws:
        `java.lang.IllegalArgumentException`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### equals

          public boolean equals(java.lang.Object obj)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`