Sonar: remove unused modifiers
[yangtools.git] / yang / yang-model-util / src / main / java / org / opendaylight / yangtools / yang / model / util / Int64.java
index 5f4202254786df35c1a3c22609bdf50c7e78eb17..ea6830fa13e90572a7eb2e6c66d89ebec0976bd4 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 int64 built-in type. <br>
@@ -16,20 +16,22 @@ import org.opendaylight.yangtools.yang.common.QName;
  * type is {@link Long}.
  *
  */
-public final class Int64 extends AbstractSignedInteger {
-    private static Int64 instance;
-    private static final QName NAME = BaseTypes.constructQName("int64");
+public final class Int64 extends AbstractSignedInteger implements Immutable {
     private static final String DESCRIPTION = "int64  represents integer values between -9223372036854775808 and 9223372036854775807, inclusively.";
 
     private Int64() {
-        super(NAME, DESCRIPTION, Integer.MIN_VALUE, Integer.MAX_VALUE, "");
+        super(BaseTypes.INT64_QNAME, DESCRIPTION, Long.MIN_VALUE, Long.MAX_VALUE, "");
     }
 
+
+    private static final Int64 INSTANCE = new Int64();
+
+    /**
+     * Returns default instance of int64 type.
+     * @return default instance of int64 type.
+     */
     public static Int64 getInstance() {
-        if (instance == null) {
-            instance = new Int64();
-        }
-        return instance;
+        return INSTANCE;
     }
 
     @Override
@@ -39,7 +41,6 @@ public final class Int64 extends AbstractSignedInteger {
 
     @Override
     public String toString() {
-        return "type " + NAME;
+        return "type " + BaseTypes.INT64_QNAME;
     }
-
 }