@FunctionalInterface public static interface HttpSpec.UndoFunction<A,K,B,O>
Modifier and Type | Method and Description |
---|---|
Optional<UndoCommand<A>> |
apply(HttpRequest<K,B> decodedInput,
O output)
The UndoFunction is a mechanism to take the result of the async http invocation and turning it into an
undo action command.
|
Optional<UndoCommand<A>> apply(HttpRequest<K,B> decodedInput, O output)
For example, if the async function calls an endpoint to book a hotel, the return value will 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
decodedInput
- the decoded input typeoutput
- the result of the async invocationOptional.empty()
if no undo function is to be generatedCopyright © 2019. All rights reserved.