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