Handle nullable lists in elanmanager
[netvirt.git] / elanmanager / impl / src / main / java / org / opendaylight / netvirt / elan / l2gw / ha / commands / TunnelCmd.java
index 11ec4350230ae4e9e9edb1b5ac213a8e818f8ca1..2d7cfc2e200bef94d35eb295607afa8d4162529a 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.netvirt.elan.l2gw.ha.commands;
 
 import java.util.List;
+import javax.annotation.Nullable;
 import org.opendaylight.netvirt.elan.l2gw.ha.HwvtepHAUtil;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalLocatorRef;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.PhysicalSwitchAugmentation;
@@ -27,6 +28,7 @@ public class TunnelCmd  extends MergeCommand<Tunnels, PhysicalSwitchAugmentation
     }
 
     @Override
+    @Nullable
     public List<Tunnels> getData(PhysicalSwitchAugmentation node) {
         if (node != null) {
             return node.getTunnels();
@@ -60,13 +62,13 @@ public class TunnelCmd  extends MergeCommand<Tunnels, PhysicalSwitchAugmentation
         HwvtepPhysicalLocatorRef hwvtepPhysicalLocatorRef1 =
                 HwvtepHAUtil.convertLocatorRef(src.getRemoteLocatorRef(), nodePath);
 
-        tunnelsBuilder.setKey(new TunnelsKey(hwvtepPhysicalLocatorRef,hwvtepPhysicalLocatorRef1));
+        tunnelsBuilder.withKey(new TunnelsKey(hwvtepPhysicalLocatorRef,hwvtepPhysicalLocatorRef1));
         return tunnelsBuilder.build();
     }
 
     @Override
     public Identifier getKey(Tunnels data) {
-        return data.getKey();
+        return data.key();
     }
 
     @Override