List<T> data1 = getData(include);
List<T> data2 = diffOf(node1, node2, compareKeyOnly);
if (HwvtepSouthboundUtil.isEmpty(data1) && HwvtepSouthboundUtil.isEmpty(data2)) {
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
List<T> result = new ArrayList<>(data1);
result.addAll(data2);
List<T> list2 = getData(node2);
if (HwvtepSouthboundUtil.isEmpty(list1)) {
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
if (HwvtepSouthboundUtil.isEmpty(list2)) {
- return HwvtepSouthboundUtil.isEmpty(list1) ? Collections.EMPTY_LIST : list1;
+ return HwvtepSouthboundUtil.isEmpty(list1) ? Collections.emptyList() : list1;
}
- Map<Object, T> map1 = list1.stream().collect(Collectors.toMap(ele -> ele.key(), ele -> ele));
- Map<Object, T> map2 = list2.stream().collect(Collectors.toMap(ele -> ele.key(), ele -> ele));
+ Map<Object, T> map1 = list1.stream().collect(Collectors.toMap(Identifiable::key, ele -> ele));
+ Map<Object, T> map2 = list2.stream().collect(Collectors.toMap(Identifiable::key, ele -> ele));
map1.entrySet().forEach(entry1 -> {
T val2 = map2.remove(entry1.getKey());
if (compareKeyOnly) {
return new HwvtepOperationalState(getConnectionInstance());
}
- protected String getNodeKeyStr(InstanceIdentifier<T> iid) {
+ protected String getNodeKeyStr(final InstanceIdentifier<T> iid) {
return getClassType().getTypeName() + "."
+ iid.firstKeyOf(Node.class).getNodeId().getValue() + "." + getKeyStr(iid);
}
- protected String getKeyStr(InstanceIdentifier<T> iid) {
+ protected String getKeyStr(final InstanceIdentifier<T> iid) {
return iid.toString();
}
- protected String getLsKeyStr(InstanceIdentifier iid) {
+ protected String getLsKeyStr(final InstanceIdentifier iid) {
return ((InstanceIdentifier<LogicalSwitches>)iid).firstKeyOf(LogicalSwitches.class)
.getHwvtepNodeName().getValue();
}
@Override
public List<InstanceIdentifier<?>> getLogicalSwitchDependencies(Identifiable data) {
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
@Override
public List<InstanceIdentifier<?>> getTerminationPointDependencies(Identifiable data) {
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
}
if (currentTxDeletedKeys.containsKey(cls)) {
return currentTxDeletedKeys.get(cls).keySet();
}
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
}
public List<? extends Identifiable> getUpdatedData(final InstanceIdentifier<Node> key,
result = modifiedData.get(key).getLeft().get(cls);
}
if (result == null) {
- result = Collections.EMPTY_LIST;
+ result = Collections.emptyList();
}
return result;
}
result = modifiedData.get(key).getRight().get(cls);
}
if (result == null) {
- result = Collections.EMPTY_LIST;
+ result = Collections.emptyList();
}
return result;
}
for (Entry<InstanceIdentifier<Node>, List<LogicalRouters>> created: removed.entrySet()) {
if (!HwvtepSouthboundUtil.isEmpty(created.getValue())) {
- getOperationalState().getDeviceInfo().scheduleTransaction(new TransactCommand() {
+ getOperationalState().getDeviceInfo().scheduleTransaction(new TransactCommand<>() {
@Override
public void execute(final TransactionBuilder transactionBuilder) {
HwvtepConnectionInstance connectionInstance = getDeviceInfo().getConnectionInstance();
HwvtepOperationalState operState = new HwvtepOperationalState(
- connectionInstance.getDataBroker(), connectionInstance, Collections.EMPTY_LIST);
+ connectionInstance.getDataBroker(), connectionInstance, Collections.emptyList());
hwvtepOperationalState = operState;
deviceTransaction = transactionBuilder;
LOG.debug("Running delete logical router in seperate tx {}", created.getKey());
private static boolean compareLocatorSets(List<LocatorSet> locatorSet1, List<LocatorSet> locatorSet2) {
if (locatorSet1 == null) {
- locatorSet1 = Collections.EMPTY_LIST;
+ locatorSet1 = Collections.emptyList();
}
if (locatorSet2 == null) {
- locatorSet2 = Collections.EMPTY_LIST;
+ locatorSet2 = Collections.emptyList();
}
if (locatorSet1.size() != locatorSet2.size()) {
return false;
}
- Set set1 = Sets.newHashSet(locatorSet1);
- Set set2 = Sets.newHashSet(locatorSet2);
+ Set<LocatorSet> set1 = Sets.newHashSet(locatorSet1);
+ Set<LocatorSet> set2 = Sets.newHashSet(locatorSet2);
return set1.containsAll(set2);
}
@Override
public List<InstanceIdentifier<?>> getLogicalSwitchDependencies(final RemoteMcastMacs data) {
if (data == null) {
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
return Lists.newArrayList(data.getLogicalSwitchRef().getValue());
}
@Override
public List<InstanceIdentifier<?>> getTerminationPointDependencies(final RemoteMcastMacs data) {
if (data == null || HwvtepSouthboundUtil.isEmpty(data.getLocatorSet())) {
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
List<InstanceIdentifier<?>> locators = new ArrayList<>();
for (LocatorSet locator: data.getLocatorSet()) {
}
@Override
- protected String getKeyStr(InstanceIdentifier<RemoteMcastMacs> iid) {
+ protected String getKeyStr(final InstanceIdentifier<RemoteMcastMacs> iid) {
return getLsKeyStr(iid.firstKeyOf(RemoteMcastMacs.class).getLogicalSwitchRef().getValue());
}
}
@Override
public List<InstanceIdentifier<?>> getLogicalSwitchDependencies(final RemoteUcastMacs data) {
if (data == null) {
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
return Lists.newArrayList(data.getLogicalSwitchRef().getValue());
}
@Override
public List<InstanceIdentifier<?>> getTerminationPointDependencies(final RemoteUcastMacs data) {
if (data == null) {
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
return Lists.newArrayList(data.getLocatorRef().getValue());
}
}
@Override
- protected String getKeyStr(InstanceIdentifier<RemoteUcastMacs> iid) {
+ protected String getKeyStr(final InstanceIdentifier<RemoteUcastMacs> iid) {
return getLsKeyStr(iid.firstKeyOf(RemoteUcastMacs.class).getLogicalSwitchRef().getValue());
}
}
LOG.info("addToDeviceUpdate {}", portUpdate);
getDeviceInfo().updateDeviceOperData(VlanBindings.class, tpPath,
portUpdate.getUuid(), portUpdate);
- getDeviceInfo().scheduleTransaction((transactionBuilder) -> {
+ getDeviceInfo().scheduleTransaction(transactionBuilder -> {
InstanceIdentifier psIid = tpPath.firstIdentifierOf(Node.class);
HwvtepOperationalState operState = new HwvtepOperationalState(getOvsdbConnectionInstance());
PhysicalPortUpdateCommand portUpdateCommand = new PhysicalPortUpdateCommand(
- operState, Collections.EMPTY_LIST);
+ operState, Collections.emptyList());
TerminationPoint cfgPoint = (TerminationPoint) data.getData();
portUpdateCommand.updatePhysicalPort(transactionBuilder, psIid,
Lists.newArrayList(cfgPoint));