@FunctionalInterface public static interface AsyncSpec.UndoFunction<A,D,O>
For example, if the async function calls an endpoint to book a hotel, the return value may include a booking reference. This booking reference is then used to create an undo action command that calls the corresponding cancel endpoint, passing in the booking reference.
Modifier and Type | Method and Description |
---|---|
Optional<UndoCommand<A>> |
apply(D decodedInput,
O output) |
Optional<UndoCommand<A>> apply(D decodedInput, O output)
decodedInput
- the decoded input typeoutput
- the result of the async invocationOptional.empty()
if no undo function is to be generatedCopyright © 2019. All rights reserved.