BUG-4638: add utility check methods for base types
[yangtools.git] / yang / yang-model-util / src / main / java / org / opendaylight / yangtools / 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.yangtools.yang.model.util;
9
10 import java.util.Collections;
11 import java.util.List;
12
13 import org.opendaylight.yangtools.concepts.Immutable;
14 import org.opendaylight.yangtools.yang.common.QName;
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.EmptyTypeDefinition;
19
20 public final class EmptyType implements EmptyTypeDefinition, Immutable {
21     private static final EmptyType INSTANCE = new EmptyType();
22     private static final QName NAME = BaseTypes.EMPTY_QNAME;
23     private static final SchemaPath PATH = SchemaPath.create(Collections.singletonList(NAME), true);
24     private static 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.";
25     private static final String REFERENCE = "https://tools.ietf.org/html/rfc6020#page-131";
26
27     private EmptyType() {
28     }
29
30     public static EmptyType getInstance() {
31         return INSTANCE;
32     }
33
34     @Override
35     public EmptyTypeDefinition getBaseType() {
36         return null;
37     }
38
39     @Override
40     public String getUnits() {
41         return null;
42     }
43
44     @Override
45     public Object getDefaultValue() {
46         return null;
47     }
48
49     @Override
50     public QName getQName() {
51         return NAME;
52     }
53
54     @Override
55     public SchemaPath getPath() {
56         return PATH;
57     }
58
59     @Override
60     public String getDescription() {
61         return DESCRIPTION;
62     }
63
64     @Override
65     public String getReference() {
66         return REFERENCE;
67     }
68
69     @Override
70     public Status getStatus() {
71         return Status.CURRENT;
72     }
73
74     @Override
75     public List<UnknownSchemaNode> getUnknownSchemaNodes() {
76         return Collections.emptyList();
77     }
78
79     @Override
80     public String toString() {
81         return "type empty " + NAME;
82     }
83
84 }