import java.util.ArrayList;
import java.util.List;
+import java.util.Objects;
+import org.eclipse.jdt.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.HwvtepGlobalAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentationBuilder;
}
@Override
+ @Nullable
public List<RemoteMcastMacs> getData(HwvtepGlobalAugmentation augmentation) {
- if (augmentation != null) {
- return augmentation.getRemoteMcastMacs();
+ if (augmentation != null && augmentation.getRemoteMcastMacs() != null) {
+ return new ArrayList<RemoteMcastMacs>(augmentation.getRemoteMcastMacs().values());
}
return null;
}
public RemoteMcastMacs transform(InstanceIdentifier<Node> nodePath, RemoteMcastMacs src) {
RemoteMcastMacsBuilder ucmlBuilder = new RemoteMcastMacsBuilder(src);
List<LocatorSet> locatorSet = new ArrayList<>();
- for (LocatorSet locator : src.getLocatorSet()) {
+ for (LocatorSet locator : src.nonnullLocatorSet()) {
locatorSet.add(new LocatorSetBuilder().setLocatorRef(HwvtepHAUtil.buildLocatorRef(nodePath,
HwvtepHAUtil.getTepIpVal(locator.getLocatorRef()))).build());
}
.getHwvtepNodeName();
InstanceIdentifier<?> origMacRefIdentifier = orig.getLogicalSwitchRef().getValue();
HwvtepNodeName origMacNodeName = origMacRefIdentifier.firstKeyOf(LogicalSwitches.class).getHwvtepNodeName();
- if (updated.getMacEntryKey().equals(orig.getMacEntryKey())
+ if (Objects.equals(updated.getMacEntryKey(), orig.getMacEntryKey())
&& updatedMacNodeName.equals(origMacNodeName)) {
List<LocatorSet> updatedLocatorSet = updated.getLocatorSet();
List<LocatorSet> origLocatorSet = orig.getLocatorSet();