BUG-614: Remove xtendisms
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / main / java / org / opendaylight / controller / sal / binding / impl / GenericNotificationRegistration.java
index 956783130caf10cf7b2b2ae45b854b93b871e72e..448adfa02e67fee46266348c76301175cca65229 100644 (file)
@@ -12,24 +12,25 @@ import org.opendaylight.yangtools.concepts.AbstractObjectRegistration;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.binding.Notification;
 
-public class GenericNotificationRegistration<T extends Notification> extends AbstractObjectRegistration<NotificationListener<T>> implements ListenerRegistration<NotificationListener<T>> {
-    private final Class<T> _type;
-
-    public Class<T> getType() {
-        return this._type;
-    }
+import com.google.common.base.Preconditions;
 
+class GenericNotificationRegistration<T extends Notification> extends AbstractObjectRegistration<NotificationListener<T>> implements ListenerRegistration<NotificationListener<T>> {
+    private final Class<T> type;
     private NotificationBrokerImpl notificationBroker;
 
     public GenericNotificationRegistration(final Class<T> type, final NotificationListener<T> instance, final NotificationBrokerImpl broker) {
         super(instance);
-        this._type = type;
-        this.notificationBroker = broker;
+        this.type = Preconditions.checkNotNull(type);
+        this.notificationBroker = Preconditions.checkNotNull(broker);
+    }
+
+    public Class<T> getType() {
+        return type;
     }
 
     @Override
     protected void removeRegistration() {
-        this.notificationBroker.unregisterListener(this);
-        this.notificationBroker = null;
+        notificationBroker.unregisterListener(this);
+        notificationBroker = null;
     }
 }