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