/* * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ package org.opendaylight.yangtools.yang.model.util; import java.util.Collections; import java.util.List; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.model.api.SchemaPath; import org.opendaylight.yangtools.yang.model.api.Status; import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode; import org.opendaylight.yangtools.yang.model.api.type.BooleanTypeDefinition; /** * The default implementation of Boolean Type Definition interface. * * @see BooleanTypeDefinition * @deprecated Use {@link org.opendaylight.yangtools.yang.model.util.type.BaseTypes#booleanType()} instead */ @Deprecated public final class BooleanType implements BooleanTypeDefinition { private static final BooleanType INSTANCE = new BooleanType(); private static final SchemaPath PATH = SchemaPath.create(true, BaseTypes.BOOLEAN_QNAME); private static final String DESCRIPTION = "The boolean built-in type represents a boolean value."; private static final String REFERENCE = "https://tools.ietf.org/html/rfc6020#section-9.5"; private static final String UNITS = ""; /** * Default constructor with default value set to "false". */ private BooleanType() { } /** * Returns default instance of boolean built-in type. * @return default instance of boolean built-in type. */ public static BooleanType getInstance() { return INSTANCE; } /* * (non-Javadoc) * * @see * org.opendaylight.yangtools.yang.model.api.TypeDefinition#getBaseType() */ @Override public BooleanTypeDefinition getBaseType() { return null; } /* * (non-Javadoc) * * @see org.opendaylight.yangtools.yang.model.api.TypeDefinition#getUnits() */ @Override public String getUnits() { return UNITS; } /* * (non-Javadoc) * * @see * org.opendaylight.yangtools.yang.model.api.TypeDefinition#getDefaultValue * () */ @Override public Object getDefaultValue() { return null; } /* * (non-Javadoc) * * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getQName() */ @Override public QName getQName() { return BaseTypes.BOOLEAN_QNAME; } /* * (non-Javadoc) * * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getPath() */ @Override public SchemaPath getPath() { return PATH; } /* * (non-Javadoc) * * @see * org.opendaylight.yangtools.yang.model.api.SchemaNode#getDescription() */ @Override public String getDescription() { return DESCRIPTION; } /* * (non-Javadoc) * * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getReference() */ @Override public String getReference() { return REFERENCE; } /* * (non-Javadoc) * * @see org.opendaylight.yangtools.yang.model.api.SchemaNode#getStatus() */ @Override public Status getStatus() { return Status.CURRENT; } @Override public List getUnknownSchemaNodes() { return Collections.emptyList(); } @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("BooleanType [name="); builder.append(BaseTypes.BOOLEAN_QNAME); builder.append(", path="); builder.append(PATH); builder.append("]"); return builder.toString(); } }