Remove yang.model.util.BaseTypes
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / type / BooleanTypeDefinition.java
index 503dbd69b838612b12fc4511b1f60675ba5cafe8..4a7eb2bbf5bdbd9cd0fc28ca7357644f2444f2a9 100644 (file)
@@ -7,12 +7,34 @@
  */
 package org.opendaylight.yangtools.yang.model.api.type;
 
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
+import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.common.YangConstants;
 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
 
 /**
- * Marker interface which marks that type definition represents the built-in
- * YANG <code>boolean</code> type.
+ * Marker interface which marks that type definition represents the built-in YANG {@code boolean} type.
  */
 public interface BooleanTypeDefinition extends TypeDefinition<BooleanTypeDefinition> {
+    /**
+     * Well-known QName of the {@code boolean} built-in type.
+     */
+    QName QNAME = QName.create(YangConstants.RFC6020_YANG_MODULE, "boolean").intern();
 
+    static int hashCode(final @NonNull BooleanTypeDefinition type) {
+        return TypeDefinitions.basicHashCode(type);
+    }
+
+    static boolean equals(final @NonNull BooleanTypeDefinition type, final @Nullable Object obj) {
+        if (type == obj) {
+            return true;
+        }
+
+        return TypeDefinitions.castIfEquals(BooleanTypeDefinition.class, type, obj) != null;
+    }
+
+    static String toString(final @NonNull BooleanTypeDefinition type) {
+        return TypeDefinitions.toStringHelper(type).toString();
+    }
 }