Cleanup checkstyle in yang-{data,model}-api
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / TypeDefinition.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.yangtools.yang.model.api;
9
10 /**
11  * YANG statement <code>typedef</code> contains also substatements
12  * <ul>
13  * <li><code>default</code> - default value which is compatible with
14  * <code>type</code>,</li>
15  * <li><code>type</code> - base type from which is <code>typedef</code> derived,
16  * </li>
17  * <li><code>units</code> - textual information about units associated with this
18  * type.</li>
19  * </ul>
20  * This interface contains the methods for getting the values of the arguments
21  * of substatements mentioned above.
22  *
23  * @param <T>
24  *            type of the base type (YANG <code>type</code> substatement) which
25  *            is included in the instance of this type
26  */
27 public interface TypeDefinition<T extends TypeDefinition<?>> extends SchemaNode {
28     /**
29      * Returns the base type from which this type is derived. If this is yang
30      * built-in type, returns null.
31      *
32      * @return value of <code>&lt;T&gt;</code> type which represents the base
33      *         type of instance of the <code>TypeDefinition</code> type or null,
34      *         if this is yang built-in type
35      */
36     T getBaseType();
37
38     /**
39      * Returns the unit which represents the value of the argument of the
40      * <code>units</code> substatement of the YANG <code>typedef</code>
41      * statement.
42      *
43      * @return string with units in which is type measured
44      */
45     String getUnits();
46
47     /**
48      * Returns the default value which represents the value of the argument of
49      * the <code>default</code> substatement of the YANG <code>typedef</code>
50      * statement.
51      *
52      * @return instance of <code>Object</code> type which contains default value
53      *         for <code>typedef</code>
54      */
55     Object getDefaultValue();
56 }