/* * 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.api; import java.util.Optional; /** * YANG statement typedef contains also substatements * * This interface contains the methods for getting the values of the arguments of substatements mentioned above. * Furthermore {@link LeafSchemaNode} and {@link LeafListSchemaNode} interfaces contribute to their internal type * definitions. * * @param * type of the base type (YANG type substatement) which * is included in the instance of this type */ // FIXME: 8.0.0: it seems this construct is mostly used in yang-data-api/codec view of the world. Introduce a dead // ringer interface at that layer, which will not have a SchemaNode implication but (perhaps) is backed // by a TypedefEffectiveStatement (or TypeEffectiveStatement?) public interface TypeDefinition> extends SchemaNode { /** * Returns the base type from which this type is derived. If this is yang built-in type, returns null. * * @return value of <T> type which represents the base * type of instance of the TypeDefinition type or null, * if this is yang built-in type */ T getBaseType(); /** * Returns the unit which represents the value of the argument of the units substatement of the YANG * typedef, leaf or leaf-list statements. * * @return string with units in which is type measured */ Optional getUnits(); /** * Returns the default value which represents the value of the argument of the default substatement * of the YANG typedef or leaf statement. * * @return instance of Object type which contains default value for typedef */ Optional getDefaultValue(); }