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..
Type Parameter
Name
Description
T
Methods
getCurrentElement()
publicabstractTgetCurrentElement()
Returns the element for which the callback has been invoked. Shortcut for
getElements().getCurrentIndex().
Returns
Type
Description
T
getCurrentIndex()
publicabstractintgetCurrentIndex()
Returns the index in the result of #getElements() of the element for which the callback
has been invoked.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-03-05 UTC."],[[["The `CallbackContext\u003cT\u003e` interface provides context for callback execution, including access to the current transaction and the element being operated on."],["`getCurrentElement()` returns the specific element associated with the callback invocation, equivalent to the element at the current index in the list of elements."],["`getCurrentIndex()` returns the position of the current element within the list of elements affected by the operation."],["`getCurrentTransaction()` provides access to the ongoing transaction, returning null if no transaction is active."],["`getElements()` returns a read-only view of all the elements involved in the operation that triggered the callback."]]],[]]