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;
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.BooleanTypeDefinition;
20 * The <code>default</code> implementation of Boolean Type Definition interface.
22 * @see BooleanTypeDefinition
24 public final class BooleanType implements BooleanTypeDefinition {
25 private static final BooleanType INSTANCE = new BooleanType();
26 private static final SchemaPath PATH = SchemaPath.create(Collections.singletonList(BaseTypes.BOOLEAN_QNAME), true);
27 private static final String DESCRIPTION = "The boolean built-in type represents a boolean value.";
28 private static final String REFERENCE = "https://tools.ietf.org/html/rfc6020#section-9.5";
29 private static final String UNITS = "";
32 * Default constructor with default value set to "false".
34 private BooleanType() {
38 * Returns default instance of boolean built-in type.
39 * @return default instance of boolean built-in type.
41 public static BooleanType getInstance() {
49 * org.opendaylight.yangtools.yang.model.api.TypeDefinition#getBaseType()
52 public BooleanTypeDefinition getBaseType() {
59 * @see org.opendaylight.yangtools.yang.model.api.TypeDefinition#getUnits()
62 public String getUnits() {
70 * org.opendaylight.yangtools.yang.model.api.TypeDefinition#getDefaultValue
74 public Object getDefaultValue() {
81 * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getQName()
84 public QName getQName() {
85 return BaseTypes.BOOLEAN_QNAME;
91 * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getPath()
94 public SchemaPath getPath() {
102 * org.opendaylight.yangtools.yang.model.api.SchemaNode#getDescription()
105 public String getDescription() {
112 * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getReference()
115 public String getReference() {
122 * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getStatus()
125 public Status getStatus() {
126 return Status.CURRENT;
130 public List<UnknownSchemaNode> getUnknownSchemaNodes() {
131 return Collections.emptyList();
135 public String toString() {
136 StringBuilder builder = new StringBuilder();
137 builder.append("BooleanType [name=");
138 builder.append(BaseTypes.BOOLEAN_QNAME);
139 builder.append(", path=");
140 builder.append(PATH);
142 return builder.toString();