com.google.appengine.api.datastore
Class PostLoadContext
- java.lang.Object
-
- com.google.appengine.api.datastore.PostLoadContext
-
- All Implemented Interfaces:
- CallbackContext<Entity>
public final class PostLoadContext extends java.lang.Object
ConcreteCallbackContext
implementation that is specific to intercepted operations that loadEntities
, currently get and "query". It is important to note that when a PostLoadContext is provided to a callback following a get operation,getElements()
returns all retrieved Entities. However, when a PostLoadContext is provided to a callback following a query, a separate PostLoadContext will be constructed for each Entity in the result set sogetElements()
will only return aList
containing a single Entity. This is due to the streaming nature of query responses.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description T
getCurrentElement()
int
getCurrentIndex()
Transaction
getCurrentTransaction()
java.util.List<T>
getElements()
java.lang.String
toString()
-
-
-
Method Detail
-
getElements
public java.util.List<T> getElements()
- Specified by:
getElements
in interfaceCallbackContext<T>
- Returns:
- An unmodifiable view of the elements involved in the operation that triggered the callback..
-
getCurrentTransaction
public Transaction getCurrentTransaction()
- Specified by:
getCurrentTransaction
in interfaceCallbackContext<T>
- Returns:
- The current transaction, or
null
if there is no current transaction.
-
getCurrentIndex
public int getCurrentIndex()
- Specified by:
getCurrentIndex
in 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:
getCurrentElement
in interfaceCallbackContext<T>
- Returns:
- The element for which the callback has been invoked. Shortcut for
getElements().getCurrentIndex()
.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-