Interface CallbackContext<T>
-
- Type Parameters:
T
- the type of element that the callback is acting on.
- All Known Implementing Classes:
DeleteContext
,PostLoadContext
,PreGetContext
,PreQueryContext
,PutContext
public interface CallbackContext<T>
Describes the context in which a callback runs. The context has access to the current transaction (if any), the element that the callback is operating on (eg the Entity being put or the Key being deleted), as well as all elements being operated on in the operation that triggered the callback..
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
getCurrentElement()
Returns the element for which the callback has been invoked.int
getCurrentIndex()
Returns the index in the result ofgetElements()
of the element for which the callback has been invoked.Transaction
getCurrentTransaction()
Returns the current transaction, ornull
if there is no current transaction.List<T>
getElements()
Returns an unmodifiable view of the elements involved in the operation that triggered the callback..
-
-
-
Method Detail
-
getElements
List<T> getElements()
Returns an unmodifiable view of the elements involved in the operation that triggered the callback..
-
getCurrentTransaction
Transaction getCurrentTransaction()
Returns the current transaction, ornull
if there is no current transaction.
-
getCurrentIndex
int getCurrentIndex()
Returns the index in the result ofgetElements()
of the element for which the callback has been invoked.
-
getCurrentElement
T getCurrentElement()
Returns the element for which the callback has been invoked. Shortcut forgetElements().getCurrentIndex()
.
-
-