X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflowplugin-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowplugin%2Fimpl%2Fservices%2Fsal%2FSalEchoServiceImpl.java;h=f0f9c91438ed1e7abcb43913087deaf7f04901c4;hb=02d039d0ac2e1bd7a178e5546321145c101bc107;hp=e8c71242cd4ecf56fd26659efe19a121761d83ec;hpb=7430f77eb8bb34e38acb5a34e3ac634b690323f4;p=openflowplugin.git diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalEchoServiceImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalEchoServiceImpl.java index e8c71242cd..f0f9c91438 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalEchoServiceImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalEchoServiceImpl.java @@ -7,13 +7,11 @@ */ package org.opendaylight.openflowplugin.impl.services.sal; -import com.google.common.base.Function; import com.google.common.base.Preconditions; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.MoreExecutors; import java.util.concurrent.Future; -import javax.annotation.Nullable; import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext; import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack; import org.opendaylight.openflowplugin.impl.services.EchoService; @@ -43,26 +41,20 @@ public final class SalEchoServiceImpl implements SalEchoService { private Future> transform(final ListenableFuture> rpcResultListenableFuture) { - return Futures.transform(rpcResultListenableFuture, - new Function, - RpcResult>() { - @Nullable - @Override - public RpcResult apply(@Nullable final RpcResult input) { - Preconditions.checkNotNull(input, "echoOutput value is never expected to be NULL"); - final RpcResult rpcOutput; - if (input.isSuccessful()) { - final SendEchoOutput sendEchoOutput = new SendEchoOutputBuilder() - .setData(input.getResult().getData()) - .build(); - rpcOutput = RpcResultBuilder.success(sendEchoOutput).build(); - } else { - rpcOutput = RpcResultBuilder.failed() - .withRpcErrors(input.getErrors()) - .build(); - } - return rpcOutput; - } - }, MoreExecutors.directExecutor()); + return Futures.transform(rpcResultListenableFuture, input -> { + Preconditions.checkNotNull(input, "echoOutput value is never expected to be NULL"); + final RpcResult rpcOutput; + if (input.isSuccessful()) { + final SendEchoOutput sendEchoOutput = new SendEchoOutputBuilder() + .setData(input.getResult().getData()) + .build(); + rpcOutput = RpcResultBuilder.success(sendEchoOutput).build(); + } else { + rpcOutput = RpcResultBuilder.failed() + .withRpcErrors(input.getErrors()) + .build(); + } + return rpcOutput; + }, MoreExecutors.directExecutor()); } }