Bug 6414: Fixed DataNodeIterator's traverseModule method
[yangtools.git] / yang / yang-model-util / src / main / java / org / opendaylight / yangtools / yang / model / util / Int8.java
index 5df2db696f39a1391fd71441016c93dde6d6df0e..d16d7dc5c14e2048738760e74db119b4fbcb79aa 100644 (file)
@@ -7,7 +7,7 @@
  */
 package org.opendaylight.yangtools.yang.model.util;
 
-import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.concepts.Immutable;
 
 /**
  * Implementation of Yang int8 built-in type. <br>
@@ -15,21 +15,24 @@ import org.opendaylight.yangtools.yang.common.QName;
  * counterpart of Yang int8 built-in type is {@link Byte}.
  *
  * @see AbstractSignedInteger
+ * @deprecated Use {@link org.opendaylight.yangtools.yang.model.util.type.BaseTypes#int8Type()} instead
  */
-public final class Int8 extends AbstractSignedInteger {
-    private static Int8 instance;
-    private static final QName NAME = BaseTypes.constructQName("int8");
+@Deprecated
+public final class Int8 extends AbstractSignedInteger implements Immutable {
     private static final String DESCRIPTION = "represents integer values between -128 and 127, inclusively.";
 
     private Int8() {
-        super(NAME, DESCRIPTION, Byte.MIN_VALUE, Byte.MAX_VALUE, "");
+        super(BaseTypes.INT8_QNAME, DESCRIPTION, Byte.MIN_VALUE, Byte.MAX_VALUE, "");
     }
 
+    private static final Int8 INSTANCE = new Int8();
+
+    /**
+     * Returns default instance of int8 type.
+     * @return default instance of int8 type.
+     */
     public static Int8 getInstance() {
-        if (instance == null) {
-            instance = new Int8();
-        }
-        return instance;
+        return INSTANCE;
     }
 
     @Override
@@ -39,7 +42,7 @@ public final class Int8 extends AbstractSignedInteger {
 
     @Override
     public String toString() {
-        return "type " + NAME;
+        return "type " + BaseTypes.INT8_QNAME;
     }
 
 }