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