com.google.appengine.api.datastore

## Class PreQueryContext

- java.lang.Object
- - com.google.appengine.api.datastore.PreQueryContext

- All Implemented Interfaces:
    CallbackContext<Query>

      public final class PreQueryContext
      extends java.lang.Object

  Concrete `CallbackContext` implementation that is specific to intercepted queries. Methods annotated with `PreQuery` that receive instances of this class may modify the `Query` returned by calling `getCurrentElement()`. This is an effective way to modify queries prior to execution.

- - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `getCurrentElement()` Returns the element for which the callback has been invoked.
    `int` | `getCurrentIndex()` Returns the index in the result of `CallbackContext.getElements()` of the element for which the callback has been invoked.
    `Transaction` | `getCurrentTransaction()` Returns the current transaction, or `null` if there is no current transaction.
    `java.util.List<T>` | `getElements()` Returns an unmodifiable view of the elements involved in the operation that triggered the callback..
    `java.lang.String` | `toString()`

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

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### getElements

          public java.util.List<T> getElements()

      Description copied from interface: `CallbackContext`
      Returns an unmodifiable view of the elements involved in the operation that triggered the callback..
      Specified by:
        `getElements` in interface `CallbackContext<T>`

    - #### getCurrentTransaction

          public Transaction getCurrentTransaction()

      Description copied from interface: `CallbackContext`
      Returns the current transaction, or `null` if there is no current transaction.
      Specified by:
        `getCurrentTransaction` in interface `CallbackContext<T>`

    - #### getCurrentIndex

          public int getCurrentIndex()

      Description copied from interface: `CallbackContext`
      Returns the index in the result of `CallbackContext.getElements()` of the element for which the callback has been invoked.
      Specified by:
        `getCurrentIndex` in interface `CallbackContext<T>`

    - #### getCurrentElement

          public T getCurrentElement()

      Description copied from interface: `CallbackContext`
      Returns the element for which the callback has been invoked. Shortcut for `getElements().getCurrentIndex()`.
      Specified by:
        `getCurrentElement` in interface `CallbackContext<T>`

    - #### toString

          public java.lang.String toString()

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