Fix inventory listeners code style 18/110718/3
authorguillaume.lambert <guillaume.lambert@orange.com>
Wed, 13 Mar 2024 16:01:00 +0000 (17:01 +0100)
committerGuillaume Lambert <guillaume.lambert@orange.com>
Thu, 14 Mar 2024 16:03:31 +0000 (16:03 +0000)
Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: I8120d9e53faf337ab4e32705782ba844ce58ca60

inventory/src/main/java/org/opendaylight/transportpce/inventory/listener/DeviceConfigListener.java
inventory/src/main/java/org/opendaylight/transportpce/inventory/listener/DeviceListener.java

index ad1c73b308bfb2ba1d2aa016d36d25cc363d1ba3..837f225dd31414509100fff6bf926f953d98c32f 100644 (file)
@@ -59,7 +59,7 @@ public class DeviceConfigListener implements DataTreeChangeListener<Node> {
             long count = netconfNode.getAvailableCapabilities().getAvailableCapability().stream()
                     .filter(cp -> cp.getCapability().contains(StringConstants.OPENROADM_DEVICE_MODEL_NAME))
                     .count();
-            LOG.debug("DCL Modification Type {}", device.getRootNode().modificationType().toString());
+            LOG.debug("DCL Modification Type {}", device.getRootNode().modificationType());
             LOG.debug("DCL Capability Count {}", count);
             LOG.debug("DCL Connection Status {}", connectionStatus);
             if (isCreate(device) || isUpdate(device)) {
@@ -111,16 +111,16 @@ public class DeviceConfigListener implements DataTreeChangeListener<Node> {
      */
     private static List<DataTreeModification<Node>> getRealDevicesOnly(Collection<DataTreeModification<Node>> changes) {
         return changes.stream()
-                .filter(change -> (change.getRootNode().dataAfter() != null
+                .filter(change ->
+                    (change.getRootNode().dataAfter() != null
                         && !StringConstants.DEFAULT_NETCONF_NODEID
-                        .equalsIgnoreCase(change.getRootNode().dataAfter().key().getNodeId().getValue())
+                            .equalsIgnoreCase(change.getRootNode().dataAfter().key().getNodeId().getValue())
                         && change.getRootNode().dataAfter().augmentation(NetconfNode.class) != null)
-                        || (change.getRootNode().dataBefore() != null
-                        && !StringConstants.DEFAULT_NETCONF_NODEID.equalsIgnoreCase(
-                        change.getRootNode().dataBefore().key().getNodeId().getValue())
-                        && change.getRootNode().dataBefore().augmentation(NetconfNode.class) != null
-
-                )).collect(Collectors.toList());
+                    || (change.getRootNode().dataBefore() != null
+                        && !StringConstants.DEFAULT_NETCONF_NODEID
+                            .equalsIgnoreCase(change.getRootNode().dataBefore().key().getNodeId().getValue())
+                        && change.getRootNode().dataBefore().augmentation(NetconfNode.class) != null))
+                .collect(Collectors.toList());
     }
 
     /**
index dac8cd441212e8efad96d10d631542ff6dd731d0..7e51845b56dea9916d4a349d1c3c7e5ec6732e79 100644 (file)
@@ -52,7 +52,7 @@ public class DeviceListener implements DataTreeChangeListener<Node> {
             long count = netconfNode.getAvailableCapabilities().getAvailableCapability().stream()
                     .filter(cp -> cp.getCapability().contains(StringConstants.OPENROADM_DEVICE_MODEL_NAME))
                     .count();
-            LOG.debug("DL Modification Type {}", device.getRootNode().modificationType().toString());
+            LOG.debug("DL Modification Type {}", device.getRootNode().modificationType());
             LOG.debug("DL Capability Count {}", count);
             LOG.debug("DL Connection Status {}", connectionStatus);
             LOG.debug("DL device.getRootNode().getDataBefore() {}", device.getRootNode().dataBefore());
@@ -111,16 +111,16 @@ public class DeviceListener implements DataTreeChangeListener<Node> {
      */
     private static List<DataTreeModification<Node>> getRealDevicesOnly(Collection<DataTreeModification<Node>> changes) {
         return changes.stream()
-                .filter(change -> (change.getRootNode().dataAfter() != null
+                .filter(change ->
+                    (change.getRootNode().dataAfter() != null
                         && !StringConstants.DEFAULT_NETCONF_NODEID
-                        .equalsIgnoreCase(change.getRootNode().dataAfter().key().getNodeId().getValue())
+                            .equalsIgnoreCase(change.getRootNode().dataAfter().key().getNodeId().getValue())
                         && change.getRootNode().dataAfter().augmentation(NetconfNode.class) != null)
-                        || (change.getRootNode().dataBefore() != null
-                        && !StringConstants.DEFAULT_NETCONF_NODEID.equalsIgnoreCase(
-                        change.getRootNode().dataBefore().key().getNodeId().getValue())
-                        && change.getRootNode().dataBefore().augmentation(NetconfNode.class) != null
-
-                )).collect(Collectors.toList());
+                    || (change.getRootNode().dataBefore() != null
+                        && !StringConstants.DEFAULT_NETCONF_NODEID
+                            .equalsIgnoreCase(change.getRootNode().dataBefore().key().getNodeId().getValue())
+                        && change.getRootNode().dataBefore().augmentation(NetconfNode.class) != null))
+                .collect(Collectors.toList());
     }
 
     /**
@@ -139,4 +139,4 @@ public class DeviceListener implements DataTreeChangeListener<Node> {
         return change.getRootNode().dataBefore() != null && change.getRootNode().dataAfter() == null
                 && ModificationType.DELETE.equals(change.getRootNode().modificationType());
     }
-}
\ No newline at end of file
+}