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.ObjectConcreteCallbackContextimplementation that is specific to intercepted queries. Methods annotated withPreQuerythat receive instances of this class may modify theQueryreturned by callinggetCurrentElement(). 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 TgetCurrentElement()intgetCurrentIndex()TransactiongetCurrentTransaction()java.util.List<T>getElements()java.lang.StringtoString()
-
-
-
Method Detail
-
getElements
public java.util.List<T> getElements()
- Specified by:
getElementsin interfaceCallbackContext<T>- Returns:
- An unmodifiable view of the elements involved in the operation that triggered the callback..
-
getCurrentTransaction
public Transaction getCurrentTransaction()
- Specified by:
getCurrentTransactionin interfaceCallbackContext<T>- Returns:
- The current transaction, or
nullif there is no current transaction.
-
getCurrentIndex
public int getCurrentIndex()
- Specified by:
getCurrentIndexin interfaceCallbackContext<T>- Returns:
- The index in the result of
CallbackContext.getElements()of the element for which the callback has been invoked.
-
getCurrentElement
public T getCurrentElement()
- Specified by:
getCurrentElementin interfaceCallbackContext<T>- Returns:
- The element for which the callback has been invoked. Shortcut for
getElements().getCurrentIndex().
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-