2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.yang.model.util;
10 import java.util.Collections;
11 import java.util.List;
13 import org.opendaylight.yangtools.yang.common.QName;
14 import org.opendaylight.yangtools.yang.model.api.IdentitySchemaNode;
15 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
16 import org.opendaylight.yangtools.yang.model.api.Status;
17 import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
18 import org.opendaylight.yangtools.yang.model.api.type.IdentityrefTypeDefinition;
21 * The <code>default</code> implementation of Identityref Type Definition
24 * @see IdentityrefTypeDefinition
26 public final class IdentityrefType implements IdentityrefTypeDefinition {
27 private final QName name = BaseTypes.constructQName("identityref");
28 private final SchemaPath path;
29 private static final String DESCRIPTION = "The identityref type is used to reference an existing identity.";
30 private static final String REFERENCE = "https://tools.ietf.org/html/rfc6020#section-9.10";
31 private final IdentitySchemaNode identity;
32 private static final String UNITS = "";
34 public IdentityrefType(IdentitySchemaNode identity, SchemaPath schemaPath) {
35 this.identity = identity;
36 this.path = schemaPath;
40 public String getUnits() {
45 public Object getDefaultValue() {
50 public QName getQName() {
55 public SchemaPath getPath() {
60 public String getDescription() {
65 public String getReference() {
70 public Status getStatus() {
71 return Status.CURRENT;
75 public List<UnknownSchemaNode> getUnknownSchemaNodes() {
76 return Collections.emptyList();
80 public IdentitySchemaNode getIdentity() {
85 public IdentityrefTypeDefinition getBaseType() {
90 public String toString() {
91 return "identityref " + identity.getQName().getLocalName();