Merge "Turn samples/pom.xml into an aggregator"
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / common / MultipartReplyTranslatorUtil.java
index 8ab3bbe2a4d723c6637ceadd1056a80e1b974dab..981b2700883b625df9a365f5a598e9bd7ac939f1 100644 (file)
@@ -8,13 +8,12 @@
 
 package org.opendaylight.openflowplugin.impl.common;
 
-import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.Optional;
 import java.util.stream.Collectors;
-import javax.annotation.Nullable;
+import org.eclipse.jdt.annotation.Nullable;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
 import org.opendaylight.openflowplugin.api.openflow.device.MessageTranslator;
 import org.opendaylight.openflowplugin.api.openflow.device.TranslatorLibrary;
@@ -120,6 +119,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.queue.id.and.statistics.map.QueueIdAndStatisticsMapBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.multipart.reply.multipart.reply.body.MultipartReplyTableFeaturesBuilder;
+import org.opendaylight.yangtools.yang.common.Uint64;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -142,7 +142,7 @@ public final class MultipartReplyTranslatorUtil {
         if (message instanceof MultipartReply) {
             final Optional<ConvertorExecutor> convertor = Optional.ofNullable(convertorExecutor);
             final Optional<TranslatorLibrary> translator = Optional.ofNullable(translatorLibrary);
-            final MultipartReply msg = MultipartReply.class.cast(message);
+            final MultipartReply msg = (MultipartReply) message;
             final OpenflowVersion ofVersion = OpenflowVersion.get(deviceInfo.getVersion());
             final VersionDatapathIdConvertorData data = new VersionDatapathIdConvertorData(deviceInfo.getVersion());
             data.setDatapathId(deviceInfo.getDatapathId());
@@ -180,11 +180,11 @@ public final class MultipartReplyTranslatorUtil {
             }
         } else if (message instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112
             .MultipartReply) {
-            return Optional.of(org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112
-                .MultipartReply.class.cast(message).getMultipartReplyBody());
+            return Optional.of(((org.opendaylight.yang.gen.v1.urn.opendaylight.multipart.types.rev170112
+                .MultipartReplymessage).getMultipartReplyBody());
         }
 
-        LOG.debug("Failed to translate {} for node {}.", message.getImplementedInterface(), deviceInfo);
+        LOG.debug("Failed to translate {} for node {}.", message.implementedInterface(), deviceInfo);
         return Optional.empty();
     }
 
@@ -271,7 +271,7 @@ public final class MultipartReplyTranslatorUtil {
             .reply.body.MultipartReplyPortStats translatePortStats(
                     final MultipartReply msg,
                     final OpenflowVersion ofVersion,
-                    final BigInteger datapathId) {
+                    final Uint64 datapathId) {
         MultipartReplyPortStatsBuilder message = new MultipartReplyPortStatsBuilder();
         MultipartReplyPortStatsCase caseBody = (MultipartReplyPortStatsCase) msg.getMultipartReplyBody();
         MultipartReplyPortStats replyBody = caseBody.getMultipartReplyPortStats();
@@ -494,7 +494,7 @@ public final class MultipartReplyTranslatorUtil {
 
     private static MultipartReplyQueueStats translateQueue(final MultipartReply msg,
                                                            final OpenflowVersion ofVersion,
-                                                           final BigInteger datapathId) {
+                                                           final Uint64 datapathId) {
         MultipartReplyQueueStatsBuilder message = new MultipartReplyQueueStatsBuilder();
         MultipartReplyQueueCase caseBody = (MultipartReplyQueueCase) msg.getMultipartReplyBody();
         MultipartReplyQueue replyBody = caseBody.getMultipartReplyQueue();