Fix checkstyle violations in sal-binding-broker
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / main / java / org / opendaylight / controller / md / sal / binding / compat / NotificationInvoker.java
index f98c8b8a53f3f6d1476ef9df377e7fbab112e285..b803c96b80c7ec998e3f257ab12a4e9f4bb59382 100644 (file)
@@ -20,7 +20,8 @@ import org.opendaylight.yangtools.yang.binding.util.BindingReflections;
 import org.opendaylight.yangtools.yang.binding.util.NotificationListenerInvoker;
 import org.opendaylight.yangtools.yang.common.QName;
 
-final class NotificationInvoker implements org.opendaylight.controller.sal.binding.api.NotificationListener<Notification> {
+final class NotificationInvoker
+        implements org.opendaylight.controller.sal.binding.api.NotificationListener<Notification> {
 
     private final NotificationListener delegate;
     private final Map<Class<? extends Notification>,InvokerContext> invokers;
@@ -29,14 +30,15 @@ final class NotificationInvoker implements org.opendaylight.controller.sal.bindi
     private NotificationInvoker(final NotificationListener listener) {
         delegate = listener;
         final Map<Class<? extends Notification>, InvokerContext> builder = new HashMap<>();
-        for(final TypeToken<?> ifaceToken : TypeToken.of(listener.getClass()).getTypes().interfaces()) {
+        for (final TypeToken<?> ifaceToken : TypeToken.of(listener.getClass()).getTypes().interfaces()) {
             final Class<?> iface = ifaceToken.getRawType();
-            if(NotificationListener.class.isAssignableFrom(iface) && BindingReflections.isBindingClass(iface)) {
+            if (NotificationListener.class.isAssignableFrom(iface) && BindingReflections.isBindingClass(iface)) {
                 @SuppressWarnings("unchecked")
-                final Class<? extends NotificationListener> listenerType = (Class<? extends NotificationListener>) iface;
+                final Class<? extends NotificationListener> listenerType =
+                        (Class<? extends NotificationListener>) iface;
                 final NotificationListenerInvoker invoker = NotificationListenerInvoker.from(listenerType);
-                for(final Class<? extends Notification> type : getNotificationTypes(listenerType)) {
-                    builder.put(type, new InvokerContext(BindingReflections.findQName(type) , invoker));
+                for (final Class<? extends Notification> type : getNotificationTypes(listenerType)) {
+                    builder.put(type, new InvokerContext(BindingReflections.findQName(type), invoker));
                 }
             }
         }
@@ -61,13 +63,15 @@ final class NotificationInvoker implements org.opendaylight.controller.sal.bindi
     }
 
     @SuppressWarnings("unchecked")
-    private static Set<Class<? extends Notification>> getNotificationTypes(final Class<? extends org.opendaylight.yangtools.yang.binding.NotificationListener> type) {
+    private static Set<Class<? extends Notification>> getNotificationTypes(
+            final Class<? extends org.opendaylight.yangtools.yang.binding.NotificationListener> type) {
         // TODO: Investigate possibility and performance impact if we cache this or expose
         // it from NotificationListenerInvoker
         final Set<Class<? extends Notification>> ret = new HashSet<>();
-        for(final Method method : type.getMethods()) {
-            if(BindingReflections.isNotificationCallback(method)) {
-                final Class<? extends Notification> notification = (Class<? extends Notification>) method.getParameterTypes()[0];
+        for (final Method method : type.getMethods()) {
+            if (BindingReflections.isNotificationCallback(method)) {
+                final Class<? extends Notification> notification =
+                        (Class<? extends Notification>) method.getParameterTypes()[0];
                 ret.add(notification);
             }
         }
@@ -87,7 +91,5 @@ final class NotificationInvoker implements org.opendaylight.controller.sal.bindi
         public void invoke(final Notification notification) {
             invoker.invokeNotification(delegate, name, notification);
         }
-
     }
-
 }