0f0bd8684effa2c33e57b69d057be13712c32673
[mdsal.git] / binding / mdsal-binding-generator-api / src / main / java / org / opendaylight / mdsal / binding / model / api / GeneratedType.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.mdsal.binding.model.api;
9
10 import java.util.List;
11 import java.util.Optional;
12
13 /**
14  * Every Java interface has to be specified with:
15  * <ul>
16  * <li><code>package</code> that belongs into</li>
17  * <li><code>interface</code> name (with commentary that <b>SHOULD</b> be
18  * present to proper define interface and base <i>contracts</i> specified for
19  * interface)</li>
20  * <li>Each Generated Type can define list of types that Generated Type can
21  * implement to extend it's definition (i.e. interface extends list of
22  * interfaces or java class implements list of interfaces)</li>
23  * <li>Each Generated Type can contain multiple enclosed definitions of
24  * Generated Types (i.e. interface can contain N enclosed interface definitions
25  * or enclosed classes)</li>
26  * <li><code>enum</code> and <code>constant</code> definitions (i.e. each
27  * constant definition is by default defined as <code>public static final</code>
28  * + type (either primitive or object) and constant name</li>
29  * <li><code>method definitions</code> with specified input parameters (with
30  * types) and return values</li>
31  * </ul>
32  *
33  * By the definition of the interface constant, enum, enclosed types and method
34  * definitions MUST be public, so there is no need to specify the scope of
35  * visibility.
36  */
37 public interface GeneratedType extends Type, DocumentedType {
38
39     /**
40      * Returns the parent type if Generated Type is defined as enclosing type,
41      * otherwise returns <code>null</code>
42      *
43      * @return the parent type if Generated Type is defined as enclosing type,
44      *         otherwise returns <code>null</code>
45      */
46     Type getParentType();
47
48     /**
49      * Returns comment string associated with Generated Type.
50      *
51      * @return comment string associated with Generated Type.
52      */
53     TypeComment getComment();
54
55     /**
56      * Returns List of annotation definitions associated with generated type.
57      *
58      * @return List of annotation definitions associated with generated type.
59      */
60     List<AnnotationType> getAnnotations();
61
62     /**
63      * Returns <code>true</code> if The Generated Type is defined as abstract.
64      *
65      * @return <code>true</code> if The Generated Type is defined as abstract.
66      */
67     boolean isAbstract();
68
69     /**
70      * Returns List of Types that Generated Type will implement.
71      *
72      * @return List of Types that Generated Type will implement.
73      */
74     List<Type> getImplements();
75
76     /**
77      * Returns List of enclosing Generated Types.
78      *
79      * @return List of enclosing Generated Types.
80      */
81     List<GeneratedType> getEnclosedTypes();
82
83     /**
84      * Returns List of all Enumerator definitions associated with Generated
85      * Type.
86      *
87      * @return List of all Enumerator definitions associated with Generated
88      *         Type.
89      */
90     List<Enumeration> getEnumerations();
91
92     /**
93      * Returns List of Constant definitions associated with Generated Type.
94      *
95      * @return List of Constant definitions associated with Generated Type.
96      */
97     List<Constant> getConstantDefinitions();
98
99     /**
100      * Returns List of Method Definitions associated with Generated Type.
101      *
102      * List does not contains getters and setters for properties.
103      *
104      * @return List of Method Definitions associated with Generated Type.
105      */
106     List<MethodSignature> getMethodDefinitions();
107
108     /**
109      * Returns List of Properties that are declared for Generated Transfer
110      * Object.
111      *
112      * @return List of Properties that are declared for Generated Transfer
113      *         Object.
114      */
115     List<GeneratedProperty> getProperties();
116
117     /**
118      * Returns the YANG definition of this type, if available.
119      *
120      * @return YANG source definition, or empty when unavailable.
121      */
122     Optional<YangSourceDefinition> getYangSourceDefinition();
123 }