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 QName NAME = BaseTypes.constructQName("boolean");
27 private static final SchemaPath PATH = new SchemaPath(Collections.singletonList(NAME), true);
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() {
38 public static BooleanType getInstance() {
46 * org.opendaylight.yangtools.yang.model.api.TypeDefinition#getBaseType()
49 public BooleanTypeDefinition getBaseType() {
56 * @see org.opendaylight.yangtools.yang.model.api.TypeDefinition#getUnits()
59 public String getUnits() {
67 * org.opendaylight.yangtools.yang.model.api.TypeDefinition#getDefaultValue
71 public Object getDefaultValue() {
78 * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getQName()
81 public QName getQName() {
88 * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getPath()
91 public SchemaPath getPath() {
99 * org.opendaylight.yangtools.yang.model.api.SchemaNode#getDescription()
102 public String getDescription() {
109 * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getReference()
112 public String getReference() {
119 * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getStatus()
122 public Status getStatus() {
123 return Status.CURRENT;
127 public List<UnknownSchemaNode> getUnknownSchemaNodes() {
128 return Collections.emptyList();
132 public String toString() {
133 StringBuilder builder = new StringBuilder();
134 builder.append("BooleanType [name=");
135 builder.append(NAME);
136 builder.append(", path=");
137 builder.append(PATH);
139 return builder.toString();