24ab0af1ad0806c82497f32d13e6a7661d860131
[controller.git] / opendaylight / sal / yang-prototype / yang / yang-model-util / src / main / java / org / opendaylight / controller / model / util / Identityref.java
1 /*\r
2   * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
3   *\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
7   */\r
8 package org.opendaylight.controller.model.util;\r
9 \r
10 import java.util.Collections;\r
11 import java.util.List;\r
12 \r
13 import org.opendaylight.controller.model.api.type.IdentityTypeDefinition;\r
14 import org.opendaylight.controller.model.api.type.IdentityrefTypeDefinition;\r
15 import org.opendaylight.controller.yang.common.QName;\r
16 import org.opendaylight.controller.yang.model.api.RevisionAwareXPath;\r
17 import org.opendaylight.controller.yang.model.api.SchemaPath;\r
18 import org.opendaylight.controller.yang.model.api.Status;\r
19 import org.opendaylight.controller.yang.model.api.UnknownSchemaNode;\r
20 \r
21 public class Identityref implements IdentityrefTypeDefinition {\r
22 \r
23     private final QName name = BaseTypes.constructQName("identityref");\r
24     private final SchemaPath path = BaseTypes.schemaPath(name);\r
25     private final String description = "";\r
26     private final String reference = "";\r
27 \r
28     private final IdentityTypeDefinition identity;\r
29     private final RevisionAwareXPath xpath;\r
30 \r
31     private String units = "";\r
32 \r
33     public Identityref(RevisionAwareXPath xpath, IdentityTypeDefinition identity) {\r
34         super();\r
35         this.identity = identity;\r
36         this.xpath = xpath;\r
37     }\r
38     \r
39     public Identityref(RevisionAwareXPath xpath) {\r
40         super();\r
41         this.xpath = xpath;\r
42         this.identity = null;\r
43     }\r
44 \r
45     /*\r
46      * (non-Javadoc)\r
47      * \r
48      * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getBaseType()\r
49      */\r
50     @Override\r
51     public IdentityTypeDefinition getBaseType() {\r
52         return identity;\r
53     }\r
54 \r
55     /*\r
56      * (non-Javadoc)\r
57      * \r
58      * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getUnits()\r
59      */\r
60     @Override\r
61     public String getUnits() {\r
62         return units;\r
63     }\r
64 \r
65     /*\r
66      * (non-Javadoc)\r
67      * \r
68      * @see org.opendaylight.controller.yang.model.api.TypeDefinition#getDefaultValue()\r
69      */\r
70     @Override\r
71     public Object getDefaultValue() {\r
72         return identity;\r
73     }\r
74 \r
75     /*\r
76      * (non-Javadoc)\r
77      * \r
78      * @see org.opendaylight.controller.yang.model.api.SchemaNode#getQName()\r
79      */\r
80     @Override\r
81     public QName getQName() {\r
82         return name;\r
83     }\r
84 \r
85     /*\r
86      * (non-Javadoc)\r
87      * \r
88      * @see org.opendaylight.controller.yang.model.api.SchemaNode#getPath()\r
89      */\r
90     @Override\r
91     public SchemaPath getPath() {\r
92         return path;\r
93     }\r
94 \r
95     /*\r
96      * (non-Javadoc)\r
97      * \r
98      * @see org.opendaylight.controller.yang.model.api.SchemaNode#getDescription()\r
99      */\r
100     @Override\r
101     public String getDescription() {\r
102         return description;\r
103     }\r
104 \r
105     /*\r
106      * (non-Javadoc)\r
107      * \r
108      * @see org.opendaylight.controller.yang.model.api.SchemaNode#getReference()\r
109      */\r
110     @Override\r
111     public String getReference() {\r
112         return reference;\r
113     }\r
114 \r
115     /*\r
116      * (non-Javadoc)\r
117      * \r
118      * @see org.opendaylight.controller.yang.model.api.SchemaNode#getStatus()\r
119      */\r
120     @Override\r
121     public Status getStatus() {\r
122         return Status.CURRENT;\r
123     }\r
124 \r
125     @Override\r
126     public List<UnknownSchemaNode> getUnknownSchemaNodes() {\r
127         return Collections.emptyList();\r
128     }\r
129 \r
130     /*\r
131      * (non-Javadoc)\r
132      * \r
133      * @see\r
134      * org.opendaylight.controller.yang.model.base.type.api.IdentityrefTypeDefinition#getIdentityName\r
135      * ()\r
136      */\r
137     @Override\r
138     public IdentityTypeDefinition getIdentity() {\r
139         return identity;\r
140     }\r
141     \r
142     @Override\r
143     public RevisionAwareXPath getPathStatement() {\r
144         return xpath;\r
145     }\r
146     \r
147     \r
148 }\r