Use Objects.equals() in yang-model-util
[yangtools.git] / yang / yang-model-util / src / main / java / org / opendaylight / yangtools / yang / model / util / BooleanType.java
index 9d7aff3366d5dcf62ffb4d79b4bcb4bca4d6c8a5..20ec00cce25147bc2a8627902e97966734ae6077 100644 (file)
@@ -18,13 +18,12 @@ import org.opendaylight.yangtools.yang.model.api.type.BooleanTypeDefinition;
 
 /**
  * The <code>default</code> implementation of Boolean Type Definition interface.
- * 
+ *
  * @see BooleanTypeDefinition
  */
 public final class BooleanType implements BooleanTypeDefinition {
     private static final BooleanType INSTANCE = new BooleanType();
-    private static final QName NAME = BaseTypes.constructQName("boolean");
-    private static final SchemaPath PATH = new SchemaPath(Collections.singletonList(NAME), true);
+    private static final SchemaPath PATH = SchemaPath.create(true, BaseTypes.BOOLEAN_QNAME);
     private static final String DESCRIPTION = "The boolean built-in type represents a boolean value.";
     private static final String REFERENCE = "https://tools.ietf.org/html/rfc6020#section-9.5";
     private static final String UNITS = "";
@@ -35,24 +34,28 @@ public final class BooleanType implements BooleanTypeDefinition {
     private BooleanType() {
     }
 
+    /**
+     * Returns default instance of boolean built-in type.
+     * @return default instance of boolean built-in type.
+     */
     public static BooleanType getInstance() {
         return INSTANCE;
     }
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.opendaylight.yangtools.yang.model.api.TypeDefinition#getBaseType()
      */
     @Override
     public BooleanTypeDefinition getBaseType() {
-        return this;
+        return null;
     }
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.TypeDefinition#getUnits()
      */
     @Override
@@ -62,7 +65,7 @@ public final class BooleanType implements BooleanTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.opendaylight.yangtools.yang.model.api.TypeDefinition#getDefaultValue
      * ()
@@ -74,17 +77,17 @@ public final class BooleanType implements BooleanTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getQName()
      */
     @Override
     public QName getQName() {
-        return NAME;
+        return BaseTypes.BOOLEAN_QNAME;
     }
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getPath()
      */
     @Override
@@ -94,7 +97,7 @@ public final class BooleanType implements BooleanTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.opendaylight.yangtools.yang.model.api.SchemaNode#getDescription()
      */
@@ -105,7 +108,7 @@ public final class BooleanType implements BooleanTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getReference()
      */
     @Override
@@ -115,7 +118,7 @@ public final class BooleanType implements BooleanTypeDefinition {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getStatus()
      */
     @Override
@@ -132,7 +135,7 @@ public final class BooleanType implements BooleanTypeDefinition {
     public String toString() {
         StringBuilder builder = new StringBuilder();
         builder.append("BooleanType [name=");
-        builder.append(NAME);
+        builder.append(BaseTypes.BOOLEAN_QNAME);
         builder.append(", path=");
         builder.append(PATH);
         builder.append("]");