@Override public <R> void register(OperationId operationId, Supplier<R> callback) { checkNotNull(operationId, "operationId cannot be null"); checkNotNull(callback, "callback cannot be null"); handle(operationId, commit -> encode(callback.get())); }
@Override public <T> void register(OperationId operationId, Consumer<Commit<T>> callback) { checkNotNull(operationId, "operationId cannot be null"); checkNotNull(callback, "callback cannot be null"); handle(operationId, commit -> { callback.accept(commit.map(this::decode)); return null; }); }
@Override public <T, R> void register(OperationId operationId, Function<Commit<T>, R> callback) { checkNotNull(operationId, "operationId cannot be null"); checkNotNull(callback, "callback cannot be null"); handle(operationId, commit -> encode(callback.apply(commit.map(this::decode)))); }