1b5abb22093080657f00037ecd2e017324214c03
[controller.git] / opendaylight / sal / yang-prototype / yang / yang-model-util / src / main / java / org / opendaylight / controller / yang / model / util / EmptyType.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.yang.model.util;
9
10 import java.net.URI;
11 import java.util.Collections;
12 import java.util.Date;
13 import java.util.List;
14
15 import org.opendaylight.controller.yang.common.QName;
16 import org.opendaylight.controller.yang.model.api.SchemaPath;
17 import org.opendaylight.controller.yang.model.api.Status;
18 import org.opendaylight.controller.yang.model.api.UnknownSchemaNode;
19 import org.opendaylight.controller.yang.model.api.type.EmptyTypeDefinition;
20
21 public class EmptyType implements EmptyTypeDefinition {
22
23     private final QName name = BaseTypes.constructQName("empty");
24     private final SchemaPath path;
25     private final String description = "The empty built-in type represents a leaf that does not have any value, it conveys information by its presence or absence.";
26     private final String reference = "https://tools.ietf.org/html/rfc6020#page-131";
27     private final EmptyTypeDefinition baseType;
28
29     private EmptyType() {
30         path = BaseTypes.schemaPath(name);
31         this.baseType = this;
32     }
33
34     public EmptyType(final List<String> actualPath,
35             final URI namespace, final Date revision) {
36         path = BaseTypes.schemaPath(actualPath, namespace, revision);
37         this.baseType = new EmptyType();
38     }
39
40     @Override
41     public EmptyTypeDefinition getBaseType() {
42         return baseType;
43     }
44
45     @Override
46     public String getUnits() {
47         return null;
48     }
49
50     @Override
51     public Object getDefaultValue() {
52         return null;
53     }
54
55     @Override
56     public QName getQName() {
57         return name;
58     }
59
60     @Override
61     public SchemaPath getPath() {
62         return path;
63     }
64
65     @Override
66     public String getDescription() {
67         return description;
68     }
69
70     @Override
71     public String getReference() {
72         return reference;
73     }
74
75     @Override
76     public Status getStatus() {
77         return Status.CURRENT;
78     }
79
80     @Override
81     public List<UnknownSchemaNode> getUnknownSchemaNodes() {
82         return Collections.emptyList();
83     }
84
85 }