Migrate to better RpcProviderService.registerRpcImplementations()
[aaa.git] / aaa-cert / src / main / java / org / opendaylight / aaa / cert / impl / AaaCertRpcServiceImpl.java
index 6c0b7c99a5d084d0f3bc8af2ad522d6791ec25b0..2382596db15196027f53a23dd0f9ebee6d93b847 100644 (file)
@@ -11,7 +11,6 @@ import static java.util.Objects.requireNonNull;
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Strings;
-import com.google.common.collect.ImmutableClassToInstanceMap;
 import com.google.common.util.concurrent.ListenableFuture;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.aaa.cert.api.IAaaCertProvider;
@@ -37,7 +36,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.yang.aaa.cert.rpc.rev151215
 import org.opendaylight.yang.gen.v1.urn.opendaylight.yang.aaa.cert.rpc.rev151215.SetODLCertificateOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.yang.aaa.cert.rpc.rev151215.SetODLCertificateOutputBuilder;
 import org.opendaylight.yangtools.concepts.Registration;
-import org.opendaylight.yangtools.yang.binding.Rpc;
 import org.opendaylight.yangtools.yang.common.ErrorTag;
 import org.opendaylight.yangtools.yang.common.ErrorType;
 import org.opendaylight.yangtools.yang.common.RpcResult;
@@ -63,13 +61,12 @@ final class AaaCertRpcServiceImpl {
     }
 
     @NonNull Registration registerWith(final RpcProviderService rpcProviderService) {
-        return rpcProviderService.registerRpcImplementations(ImmutableClassToInstanceMap.<Rpc<?, ?>>builder()
-            .put(GetNodeCertificate.class, this::getNodeCertificate)
-            .put(SetNodeCertificate.class, this::setNodeCertificate)
-            .put(GetODLCertificate.class, this::getODLCertificate)
-            .put(SetODLCertificate.class, this::setODLCertificate)
-            .put(GetODLCertificateReq.class, this::getODLCertificateReq)
-            .build());
+        return rpcProviderService.registerRpcImplementations(
+            (GetNodeCertificate) this::getNodeCertificate,
+            (SetNodeCertificate) this::setNodeCertificate,
+            (GetODLCertificate) this::getODLCertificate,
+            (SetODLCertificate) this::setODLCertificate,
+            (GetODLCertificateReq) this::getODLCertificateReq);
     }
 
     @VisibleForTesting