BUG-7698: do not allow nulls in registrations
[yangtools.git] / common / concepts / src / main / java / org / opendaylight / yangtools / concepts / ObjectRegistration.java
index 6a727ebc91eab2715a80206cac1a17f2128b5247..f2eafef209c0a60a4732ef7bc806231d82b20ff2 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.yangtools.concepts;
 
+import javax.annotation.Nonnull;
+
 /**
  * Class representing a registration of an object. Such a registration is
  * a proper resource and should be cleaned up when no longer required, so
@@ -20,7 +22,7 @@ public interface ObjectRegistration<T> extends Registration {
      *
      * @return Registered object.
      */
-    T getInstance();
+    @Nonnull T getInstance();
 
     /**
      * Unregisters the object. This operation is required not to invoke