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;
12 import org.opendaylight.yangtools.yang.common.QName;
13 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
14 import org.opendaylight.yangtools.yang.model.api.Status;
15 import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
16 import org.opendaylight.yangtools.yang.model.api.type.BooleanTypeDefinition;
19 * The <code>default</code> implementation of Boolean Type Definition interface.
21 * @see BooleanTypeDefinition
22 * @deprecated Use {@link org.opendaylight.yangtools.yang.model.util.type.BaseTypes#booleanType()} instead
25 public final class BooleanType implements BooleanTypeDefinition {
26 private static final BooleanType INSTANCE = new BooleanType();
27 private static final SchemaPath PATH = SchemaPath.create(true, BaseTypes.BOOLEAN_QNAME);
28 private static final String DESCRIPTION = "The boolean built-in type represents a boolean value.";
29 private static final String REFERENCE = "https://tools.ietf.org/html/rfc6020#section-9.5";
30 private static final String UNITS = "";
33 * Default constructor with default value set to "false".
35 private BooleanType() {
39 * Returns default instance of boolean built-in type.
40 * @return default instance of boolean built-in type.
42 public static BooleanType getInstance() {
50 * org.opendaylight.yangtools.yang.model.api.TypeDefinition#getBaseType()
53 public BooleanTypeDefinition getBaseType() {
60 * @see org.opendaylight.yangtools.yang.model.api.TypeDefinition#getUnits()
63 public String getUnits() {
71 * org.opendaylight.yangtools.yang.model.api.TypeDefinition#getDefaultValue
75 public Object getDefaultValue() {
82 * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getQName()
85 public QName getQName() {
86 return BaseTypes.BOOLEAN_QNAME;
92 * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getPath()
95 public SchemaPath getPath() {
103 * org.opendaylight.yangtools.yang.model.api.SchemaNode#getDescription()
106 public String getDescription() {
113 * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getReference()
116 public String getReference() {
123 * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getStatus()
126 public Status getStatus() {
127 return Status.CURRENT;
131 public List<UnknownSchemaNode> getUnknownSchemaNodes() {
132 return Collections.emptyList();
136 public String toString() {
137 StringBuilder builder = new StringBuilder();
138 builder.append("BooleanType [name=");
139 builder.append(BaseTypes.BOOLEAN_QNAME);
140 builder.append(", path=");
141 builder.append(PATH);
143 return builder.toString();