*/
package org.opendaylight.yangtools.yang.model.util;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.model.api.type.IntegerTypeDefinition;
+import org.opendaylight.yangtools.concepts.Immutable;
/**
* Implementation of Yang int8 built-in type. <br>
* int8 represents integer values between -128 and 127, inclusively. The Java
* counterpart of Yang int8 built-in type is {@link Byte}.
- *
+ *
* @see AbstractSignedInteger
*/
-public final class Int8 extends AbstractSignedInteger {
- private static Int8 instance;
- private static final QName NAME = BaseTypes.constructQName("int8");
+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, "");
}
- public static Int8 getInstance() {
- if (instance == null) {
- instance = new Int8();
- }
- return instance;
- }
+ private static final Int8 INSTANCE = new Int8();
- @Override
- public IntegerTypeDefinition getBaseType() {
- return this;
+ /**
+ * Returns default instance of int8 type.
+ * @return default instance of int8 type.
+ */
+ public static Int8 getInstance() {
+ return INSTANCE;
}
@Override
@Override
public String toString() {
- return "type " + NAME;
+ return "type " + BaseTypes.INT8_QNAME;
}
}