2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
\r
4 * This program and the accompanying materials are made available under the
\r
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
\r
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
\r
8 package org.opendaylight.controller.yang.model.util;
\r
10 import java.net.URI;
\r
11 import java.util.Collections;
\r
12 import java.util.Date;
\r
13 import java.util.List;
\r
15 import org.opendaylight.controller.yang.common.QName;
\r
16 import org.opendaylight.controller.yang.model.api.SchemaPath;
\r
17 import org.opendaylight.controller.yang.model.api.Status;
\r
18 import org.opendaylight.controller.yang.model.api.UnknownSchemaNode;
\r
19 import org.opendaylight.controller.yang.model.api.type.IdentityrefTypeDefinition;
\r
22 * The <code>default</code> implementation of Identityref Type Definition interface.
\r
24 * @see IdentityrefTypeDefinition
\r
26 public class IdentityrefType implements IdentityrefTypeDefinition {
\r
28 private final QName name = BaseTypes.constructQName("identityref");
\r
29 private final SchemaPath path;
\r
30 private final String description = "The identityref type is used to reference an existing identity.";
\r
31 private final String reference = "https://tools.ietf.org/html/rfc6020#section-9.10";
\r
32 private final IdentityrefTypeDefinition baseType;
\r
34 private final QName identity;
\r
36 private String units = "";
\r
38 private IdentityrefType(QName identity) {
\r
39 this.identity = identity;
\r
40 this.path = BaseTypes.schemaPath(name);
\r
41 this.baseType = this;
\r
44 public IdentityrefType(QName identity, SchemaPath schemaPath) {
\r
45 this.identity = identity;
\r
46 this.path = schemaPath;
\r
47 this.baseType = new IdentityrefType(identity);
\r
50 public IdentityrefType(final List<String> actualPath,
\r
51 final URI namespace, final Date revision, final QName identity) {
\r
52 this.identity = identity;
\r
53 this.path = BaseTypes.schemaPath(actualPath, namespace, revision);
\r
54 this.baseType = new IdentityrefType(identity);
\r
58 public String getUnits() {
\r
63 public Object getDefaultValue() {
\r
68 public QName getQName() {
\r
73 public SchemaPath getPath() {
\r
78 public String getDescription() {
\r
83 public String getReference() {
\r
88 public Status getStatus() {
\r
89 return Status.CURRENT;
\r
93 public List<UnknownSchemaNode> getUnknownSchemaNodes() {
\r
94 return Collections.emptyList();
\r
98 public QName getIdentity() {
\r
103 public IdentityrefTypeDefinition getBaseType() {
\r