Add ability to get yang sources from SchemaContext.
[yangtools.git] / concepts / src / main / java / org / opendaylight / yangtools / concepts / AbstractObjectRegistration.java
index 03ae939a7b430c11d484af230aba72abcea205ca..8854863e55859c0eb1ad343055970d53b14b88ab 100644 (file)
@@ -1,30 +1,36 @@
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.yangtools.concepts;\r
-\r
-/**\r
- * Utility registration handle. It is a convenience for register-style method\r
- * which can return an AutoCloseable realized by a subclass of this class.\r
- * Invoking the close() method triggers unregistration of the state the method\r
- * installed.\r
- */\r
-public abstract class AbstractObjectRegistration<T> extends AbstractRegistration implements Registration<T> {\r
-\r
-    \r
-    private final T instance;\r
-\r
-    public AbstractObjectRegistration(T instance) {\r
-        this.instance = instance;\r
-    }\r
-\r
-    @Override\r
-    public final T getInstance() {\r
-        return instance;\r
-    }\r
-\r
-}\r
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yangtools.concepts;
+
+/**
+ * Utility registration handle. It is a convenience for register-style method
+ * which can return an AutoCloseable realized by a subclass of this class.
+ * Invoking the close() method triggers unregistration of the state the method
+ * installed.
+ */
+public abstract class AbstractObjectRegistration<T> extends AbstractRegistration implements ObjectRegistration<T> {
+    private final T instance;
+
+    protected AbstractObjectRegistration(final T instance) {
+        this.instance = instance;
+    }
+
+    @Override
+    public final T getInstance() {
+        return instance;
+    }
+
+
+    @Override
+    public String toString() {
+        return "AbstractObjectRegistration{" +
+                "instance=" + instance +
+                '}';
+    }
+}
+