X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fsal%2Fyang-prototype%2Fyang%2Fyang-model-util%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fyang%2Fmodel%2Futil%2FBinaryType.java;h=253fe484f0459a7f410014814a549166c5477dbd;hb=refs%2Fchanges%2F60%2F260%2F2;hp=70298a7e07bf3e9bd94d3b743e3c1b649f022396;hpb=4ce0f6630bc576b97c8c9a08848aafb6e90a75b0;p=controller.git
diff --git a/opendaylight/sal/yang-prototype/yang/yang-model-util/src/main/java/org/opendaylight/controller/yang/model/util/BinaryType.java b/opendaylight/sal/yang-prototype/yang/yang-model-util/src/main/java/org/opendaylight/controller/yang/model/util/BinaryType.java
index 70298a7e07..253fe484f0 100644
--- a/opendaylight/sal/yang-prototype/yang/yang-model-util/src/main/java/org/opendaylight/controller/yang/model/util/BinaryType.java
+++ b/opendaylight/sal/yang-prototype/yang/yang-model-util/src/main/java/org/opendaylight/controller/yang/model/util/BinaryType.java
@@ -7,8 +7,10 @@
*/
package org.opendaylight.controller.yang.model.util;
+import java.net.URI;
import java.util.ArrayList;
import java.util.Collections;
+import java.util.Date;
import java.util.List;
import org.opendaylight.controller.yang.common.QName;
@@ -20,43 +22,55 @@ import org.opendaylight.controller.yang.model.api.type.LengthConstraint;
/**
* The default
implementation of Binary Type Definition interface.
- *
+ *
* @see BinaryTypeDefinition
*/
public class BinaryType implements BinaryTypeDefinition {
private final QName name = BaseTypes.constructQName("binary");
- private final SchemaPath path = BaseTypes.schemaPath(name);
+ private final SchemaPath path;
private final String description = "The binary built-in type represents any binary data, i.e., a sequence of octets.";
private final String reference = "https://tools.ietf.org/html/rfc6020#section-9.8";
-
+ private final BinaryTypeDefinition baseType;
private List bytes;
private final List lengthConstraints;
private String units = "";
- /**
- *
- */
- public BinaryType() {
+ private BinaryType() {
+ super();
+
+ final List constraints = new ArrayList();
+ constraints.add(BaseConstraints.lengthConstraint(0, Long.MAX_VALUE, "", ""));
+ this.lengthConstraints = Collections.unmodifiableList(constraints);
+ this.bytes = Collections.emptyList();
+ this.path = BaseTypes.schemaPath(name);
+ this.baseType = this;
+ }
+
+ public BinaryType(final List actualPath, final URI namespace,
+ final Date revision) {
super();
-
+
final List constraints = new ArrayList();
constraints.add(BaseConstraints.lengthConstraint(0, Long.MAX_VALUE, "", ""));
- lengthConstraints = Collections.unmodifiableList(constraints);
- bytes = Collections.emptyList();
+ this.lengthConstraints = Collections.unmodifiableList(constraints);
+ this.bytes = Collections.emptyList();
+ this.path = BaseTypes.schemaPath(actualPath, namespace, revision);
+ this.baseType = new BinaryType();
}
/**
- *
- *
+ *
+ *
* @param bytes
* @param lengthConstraints
* @param units
*/
- public BinaryType(final List bytes,
+ public BinaryType(final List actualPath, final URI namespace,
+ final Date revision, final List bytes,
final List lengthConstraints, final String units) {
super();
-
+
if ((lengthConstraints == null) || (lengthConstraints.isEmpty())) {
final List constraints = new ArrayList();
constraints.add(BaseConstraints.lengthConstraint(0, Long.MAX_VALUE, "", ""));
@@ -64,9 +78,11 @@ public class BinaryType implements BinaryTypeDefinition {
} else {
this.lengthConstraints = Collections.unmodifiableList(lengthConstraints);
}
-
+
+ this.path = BaseTypes.schemaPath(actualPath, namespace, revision);
this.bytes = Collections.unmodifiableList(bytes);
this.units = units;
+ this.baseType = new BinaryType();
}
/*
@@ -76,7 +92,7 @@ public class BinaryType implements BinaryTypeDefinition {
*/
@Override
public BinaryTypeDefinition getBaseType() {
- return this;
+ return baseType;
}
/*