Added NotificationListener interfaces
[yangtools.git] / code-generator / binding-model-api / src / main / java / org / opendaylight / yangtools / sal / binding / model / api / type / builder / GeneratedTypeBuilderBase.java
1 package org.opendaylight.yangtools.sal.binding.model.api.type.builder;
2
3 import org.opendaylight.yangtools.sal.binding.model.api.Constant;
4 import org.opendaylight.yangtools.sal.binding.model.api.GeneratedType;
5 import org.opendaylight.yangtools.sal.binding.model.api.Type;
6
7 public interface GeneratedTypeBuilderBase <T extends GeneratedTypeBuilderBase<T>> extends Type {
8
9     /**
10      * Adds new Enclosing Transfer Object into definition of Generated Type and
11      * returns <code>new</code> Instance of Generated TO Builder. <br>
12      * There is no need of specifying of Package Name because enclosing Type is
13      * already defined inside Generated Type with specific package name. <br>
14      * The name of enclosing Type cannot be same as Name of parent type and if
15      * there is already defined enclosing type with the same name, the new
16      * enclosing type will simply overwrite the older definition. <br>
17      * If the name of enclosing type is <code>null</code> the method SHOULD
18      * throw {@link IllegalArgumentException}
19      * 
20      * @param name
21      *            Name of Enclosing Type
22      * @return <code>new</code> Instance of Generated Type Builder.
23      */
24     public GeneratedTOBuilder addEnclosingTransferObject(final String name);
25
26     /**
27      * Adds new Enclosing Transfer Object <code>genTOBuilder</code> into
28      * definition of Generated Type
29      * 
30      * <br>
31      * There is no need of specifying of Package Name because enclosing Type is
32      * already defined inside Generated Type with specific package name. <br>
33      * The name of enclosing Type cannot be same as Name of parent type and if
34      * there is already defined enclosing type with the same name, the new
35      * enclosing type will simply overwrite the older definition. <br>
36      * If the parameter <code>genTOBuilder</code> of enclosing type is
37      * <code>null</code> the method SHOULD throw
38      * {@link IllegalArgumentException}
39      * 
40      * @param <code>genTOBuilder</code> Name of Enclosing Type
41      */
42     public T addEnclosingTransferObject(final GeneratedTOBuilder genTOBuilder);
43
44     /**
45      * Adds String definition of comment into Method Signature definition. <br>
46      * The comment String MUST NOT contain anny comment specific chars (i.e.
47      * "/**" or "//") just plain String text description.
48      * 
49      * @param comment
50      *            Comment String.
51      */
52     public T addComment(final String comment);
53
54     /**
55      * The method creates new AnnotationTypeBuilder containing specified package
56      * name an annotation name. <br>
57      * Neither the package name or annotation name can contain <code>null</code>
58      * references. In case that any of parameters contains <code>null</code> the
59      * method SHOULD thrown {@link IllegalArgumentException}
60      * 
61      * @param packageName
62      *            Package Name of Annotation Type
63      * @param name
64      *            Name of Annotation Type
65      * @return <code>new</code> instance of Annotation Type Builder.
66      */
67     public AnnotationTypeBuilder addAnnotation(final String packageName, final String name);
68
69     /**
70      * Sets the <code>abstract</code> flag to define Generated Type as
71      * <i>abstract</i> type.
72      * 
73      * @param isAbstract
74      *            abstract flag
75      */
76     public T setAbstract(boolean isAbstract);
77
78     /**
79      * Add Type to implements.
80      * 
81      * @param genType
82      *            Type to implement
83      * @return <code>true</code> if the addition of type is successful.
84      */
85     public T addImplementsType(final Type genType);
86
87     /**
88      * Adds Constant definition and returns <code>new</code> Constant instance. <br>
89      * By definition Constant MUST be defined by return Type, Name and assigned
90      * value. The name SHOULD be defined with capital letters. Neither of method
91      * parameters can be <code>null</code> and the method SHOULD throw
92      * {@link IllegalArgumentException} if the contract is broken.
93      * 
94      * @param type
95      *            Constant Type
96      * @param name
97      *            Name of Constant
98      * @param value
99      *            Assigned Value
100      * @return <code>new</code> Constant instance.
101      */
102     public Constant addConstant(final Type type, final String name, final Object value);
103
104     /**
105      * Adds new Enumeration definition for Generated Type Builder and returns
106      * Enum Builder for specifying all Enum parameters. <br>
107      * If there is already Enumeration stored with the same name, the old enum
108      * will be simply overwritten byt new enum definition. <br>
109      * Name of Enumeration cannot be <code>null</code>, if it is
110      * <code>null</code> the method SHOULD throw
111      * {@link IllegalArgumentException}
112      * 
113      * @param name
114      *            Enumeration Name
115      * @return <code>new</code> instance of Enumeration Builder.
116      */
117     public EnumBuilder addEnumeration(final String name);
118
119     /**
120      * Add new Method Signature definition for Generated Type Builder and
121      * returns Method Signature Builder for specifying all Method parameters. <br>
122      * Name of Method cannot be <code>null</code>, if it is <code>null</code>
123      * the method SHOULD throw {@link IllegalArgumentException} <br>
124      * By <i>Default</i> the MethodSignatureBuilder SHOULD be pre-set as
125      * {@link MethodSignatureBuilder#setAbstract(true)},
126      * {@link MethodSignatureBuilder#setFinal(false)} and
127      * {@link MethodSignatureBuilder#setAccessModifier(PUBLIC)}
128      * 
129      * @param name
130      *            Name of Method
131      * @return <code>new</code> instance of Method Signature Builder.
132      */
133     public MethodSignatureBuilder addMethod(final String name);
134
135     /**
136      * Checks if GeneratedTypeBuilder contains method with name
137      * <code>methodName</code>
138      * 
139      * @param methodName
140      *            is method name
141      */
142     public boolean containsMethod(final String methodName);
143     
144     /**
145      * Add new Generated Property definition for Generated Transfer Object
146      * Builder and returns Generated Property Builder for specifying Property. <br>
147      * Name of Property cannot be <code>null</code>, if it is <code>null</code>
148      * the method SHOULD throw {@link IllegalArgumentException}
149      * 
150      * @param name
151      *            Name of Property
152      * @return <code>new</code> instance of Generated Property Builder.
153      */
154     public GeneratedPropertyBuilder addProperty(final String name);
155
156     /**
157      * Check whether GeneratedTOBuilder contains property with name
158      * <code>name</code>
159      * 
160      * @param name
161      *            of property which existance is checked
162      * @return true if property <code>name</code> exists in list of properties.
163      */
164     public boolean containsProperty(final String name);
165
166
167     
168 }