R
- the type of result of the command handlingC
- the type of payload of the command@FunctionalInterface public interface CommandCallback<C,R>
Modifier and Type | Method and Description |
---|---|
void |
onResult(CommandMessage<? extends C> commandMessage,
CommandResultMessage<? extends R> commandResultMessage)
Invoked when command handling execution is completed.
|
default CommandCallback<C,R> |
wrap(CommandCallback<C,R> wrappingCallback)
Wraps the command callback with another using a
WrappedCommandCallback . |
void onResult(@Nonnull CommandMessage<? extends C> commandMessage, @Nonnull CommandResultMessage<? extends R> commandResultMessage)
commandMessage
- the CommandMessage
that was dispatchedcommandResultMessage
- the CommandResultMessage
of the command handling executiondefault CommandCallback<C,R> wrap(CommandCallback<C,R> wrappingCallback)
WrappedCommandCallback
. If provided with a null
callback this method will not wrap it, keeping the original callback instead.
In effect, the given callback will be executed first, and then the original will be executed second. You can wrap callback as many times as you'd like.
wrappingCallback
- The command callback that should wrap the current instanceWrappedCommandCallback
representing the execution of both callbacksCopyright © 2010–2023. All rights reserved.