Search in sources :

Example 1 with SendEchoOutputBuilder

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());
}
Also used : SendEchoOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.echo.service.rev150305.SendEchoOutput) SendEchoOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.echo.service.rev150305.SendEchoOutputBuilder)

Aggregations

SendEchoOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.echo.service.rev150305.SendEchoOutput)1 SendEchoOutputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.echo.service.rev150305.SendEchoOutputBuilder)1