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() {
37 public static BooleanType getInstance() {
45 * org.opendaylight.yangtools.yang.model.api.TypeDefinition#getBaseType()
48 public BooleanTypeDefinition getBaseType() {
55 * @see org.opendaylight.yangtools.yang.model.api.TypeDefinition#getUnits()
58 public String getUnits() {
66 * org.opendaylight.yangtools.yang.model.api.TypeDefinition#getDefaultValue
70 public Object getDefaultValue() {
77 * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getQName()
80 public QName getQName() {
81 return BaseTypes.BOOLEAN_QNAME;
87 * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getPath()
90 public SchemaPath getPath() {
98 * org.opendaylight.yangtools.yang.model.api.SchemaNode#getDescription()
101 public String getDescription() {
108 * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getReference()
111 public String getReference() {
118 * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getStatus()
121 public Status getStatus() {
122 return Status.CURRENT;
126 public List<UnknownSchemaNode> getUnknownSchemaNodes() {
127 return Collections.emptyList();
131 public String toString() {
132 StringBuilder builder = new StringBuilder();
133 builder.append("BooleanType [name=");
134 builder.append(BaseTypes.BOOLEAN_QNAME);
135 builder.append(", path=");
136 builder.append(PATH);
138 return builder.toString();