Modified construction of built-in yang types.
[controller.git] / opendaylight / sal / yang-prototype / yang / yang-model-util / src / main / java / org / opendaylight / controller / yang / model / util / BooleanType.java
index f588bf425c9ae4ed2f6deabd91cf723bc6b9d2fd..04b2dc90d1ac66f507926d0e9edff0c51b63f682 100644 (file)
@@ -7,9 +7,7 @@
  */
 package org.opendaylight.controller.yang.model.util;
 
-import java.net.URI;
 import java.util.Collections;
-import java.util.Date;
 import java.util.List;
 
 import org.opendaylight.controller.yang.common.QName;
@@ -23,63 +21,36 @@ import org.opendaylight.controller.yang.model.api.type.BooleanTypeDefinition;
  *
  * @see BooleanTypeDefinition
  */
-public class BooleanType implements BooleanTypeDefinition {
-
+public final class BooleanType implements BooleanTypeDefinition {
     private final QName name = BaseTypes.constructQName("boolean");
     private final SchemaPath path;
     private final String description = "The boolean built-in type represents a boolean value.";
     private final String reference = "https://tools.ietf.org/html/rfc6020#section-9.5";
     private final BooleanTypeDefinition baseType;
     private final Boolean defaultValue;
-    private String units = "";
+    private final String units = "";
 
     /**
      * Default constructor with default value set to "false".
      */
-    private BooleanType() {
+    public BooleanType(final SchemaPath path) {
         super();
         this.defaultValue = false;
-        this.path = BaseTypes.schemaPath(name);
+        this.path = path;
         this.baseType = this;
     }
 
-    public BooleanType(final List<String> actualPath, final URI namespace,
-            final Date revision) {
-        super();
-        this.defaultValue = false;
-        this.path = BaseTypes.schemaPath(actualPath, namespace, revision);
-        this.baseType = new BooleanType();
-    }
-
-    /**
-     * Boolean Type constructor.
-     *
-     * @param defaultValue
-     *            Default Value
-     */
-    public BooleanType(final List<String> actualPath, final URI namespace,
-            final Date revision, final Boolean defaultValue) {
-        super();
-        this.defaultValue = defaultValue;
-        this.path = BaseTypes.schemaPath(actualPath, namespace, revision);
-        this.baseType = new BooleanType();
-    }
-
     /**
      * Boolean Type constructor.
      *
      * @param defaultValue
      *            Default Value
-     * @param units
-     *            Units
      */
-    public BooleanType(final List<String> actualPath, final URI namespace,
-            final Date revision, final Boolean defaultValue, final String units) {
+    public BooleanType(final SchemaPath path, final Boolean defaultValue) {
         super();
         this.defaultValue = defaultValue;
-        this.units = units;
-        this.path = BaseTypes.schemaPath(actualPath, namespace, revision);
-        this.baseType = new BooleanType();
+        this.path = path;
+        this.baseType = this;
     }
 
     /*