use of org.opendaylight.yang.gen.v1.urn.opendaylight.echo.service.rev150305.SendEchoOutputBuilder in project openflowplugin by opendaylight.
the class SalEchoServiceImpl method transform.
private Future<RpcResult<SendEchoOutput>> transform(final ListenableFuture<RpcResult<EchoOutput>> rpcResultListenableFuture) {
return Futures.transform(rpcResultListenableFuture, input -> {
Preconditions.checkNotNull(input, "echoOutput value is never expected to be NULL");
final RpcResult<SendEchoOutput> rpcOutput;
if (input.isSuccessful()) {
final SendEchoOutput sendEchoOutput = new SendEchoOutputBuilder().setData(input.getResult().getData()).build();
rpcOutput = RpcResultBuilder.success(sendEchoOutput).build();
} else {
rpcOutput = RpcResultBuilder.<SendEchoOutput>failed().withRpcErrors(input.getErrors()).build();
}
return rpcOutput;
}, MoreExecutors.directExecutor());
}
Aggregations