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%2FIdentityrefType.java;h=533318e39e3c15e8ac5fc1fcde2ac5d36fb669f0;hb=refs%2Fchanges%2F60%2F260%2F2;hp=3837f72a8ae6d937e6d96f2e4c79da2865330a41;hpb=184e4f61d034f6c83da75de288d4f56ec48f60bf;p=controller.git diff --git a/opendaylight/sal/yang-prototype/yang/yang-model-util/src/main/java/org/opendaylight/controller/yang/model/util/IdentityrefType.java b/opendaylight/sal/yang-prototype/yang/yang-model-util/src/main/java/org/opendaylight/controller/yang/model/util/IdentityrefType.java index 3837f72a8a..533318e39e 100644 --- a/opendaylight/sal/yang-prototype/yang/yang-model-util/src/main/java/org/opendaylight/controller/yang/model/util/IdentityrefType.java +++ b/opendaylight/sal/yang-prototype/yang/yang-model-util/src/main/java/org/opendaylight/controller/yang/model/util/IdentityrefType.java @@ -7,7 +7,9 @@ */ 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; @@ -24,16 +26,32 @@ import org.opendaylight.controller.yang.model.api.type.IdentityrefTypeDefinition public class IdentityrefType implements IdentityrefTypeDefinition { private final QName name = BaseTypes.constructQName("identityref"); - private final SchemaPath path = BaseTypes.schemaPath(name); + private final SchemaPath path; private final String description = "The identityref type is used to reference an existing identity."; private final String reference = "https://tools.ietf.org/html/rfc6020#section-9.10"; + private final IdentityrefTypeDefinition baseType; private final QName identity; private String units = ""; - public IdentityrefType(QName identity) { + private IdentityrefType(QName identity) { this.identity = identity; + this.path = BaseTypes.schemaPath(name); + this.baseType = this; + } + + public IdentityrefType(QName identity, SchemaPath schemaPath) { + this.identity = identity; + this.path = schemaPath; + this.baseType = new IdentityrefType(identity); + } + + public IdentityrefType(final List actualPath, + final URI namespace, final Date revision, final QName identity) { + this.identity = identity; + this.path = BaseTypes.schemaPath(actualPath, namespace, revision); + this.baseType = new IdentityrefType(identity); } @Override @@ -83,7 +101,7 @@ public class IdentityrefType implements IdentityrefTypeDefinition { @Override public IdentityrefTypeDefinition getBaseType() { - return this; + return baseType; } }