1 // Copyright 2011 Google Inc. All Rights Reserved.
2 package com
.google
.appengine
.api
.datastore
;
7 * Describes the context in which a callback runs. The context has access to
8 * the current transaction (if any), the element that the callback is
9 * operating on (eg the Entity being put or the Key being deleted), as well as
10 * all elements being operated on in the operation that triggered the callback..
12 * @param <T> the type of element that the callback is acting on.
15 public interface CallbackContext
<T
> {
17 * @return An unmodifiable view of the elements involved in the operation
18 * that triggered the callback..
20 List
<T
> getElements();
23 * @return The current transaction, or {@code null} if there is no current
26 Transaction
getCurrentTransaction();
29 * @return The index in the result of {@link #getElements()} of the element
30 * for which the callback has been invoked.
32 int getCurrentIndex();
35 * @return The element for which the callback has been invoked. Shortcut
36 * for {@code getElements().getCurrentIndex()}.
38 T
getCurrentElement();