- HwvtepGlobalAugmentation hgAugmentation = nodeOptional.get();
- List<LogicalSwitches> lswitchList = null;
- if (hgAugmentation != null) {
- lswitchList = hgAugmentation.getLogicalSwitches();
- }
- if (lswitchList != null) {
- for (LogicalSwitches lswitch: lswitchList) {
- if (lswitch.key().equals(logicalSwitchesKey)) {
- return Optional.fromNullable(lswitch);
- }
- }
+ LogicalSwitches lswitch = nodeOptional.get().nonnullLogicalSwitches().get(logicalSwitchesKey);
+ if (lswitch != null) {
+ return Optional.of(lswitch);