1 package org.opendaylight.yangtools.sal.binding.model.api.type.builder;
3 import org.opendaylight.yangtools.sal.binding.model.api.Constant;
4 import org.opendaylight.yangtools.sal.binding.model.api.Type;
6 public interface GeneratedTypeBuilderBase<T extends GeneratedTypeBuilderBase<T>> extends Type {
9 * Adds new Enclosing Transfer Object into definition of Generated Type and
10 * returns <code>new</code> Instance of Generated TO Builder. <br>
11 * There is no need of specifying of Package Name because enclosing Type is
12 * already defined inside Generated Type with specific package name. <br>
13 * The name of enclosing Type cannot be same as Name of parent type and if
14 * there is already defined enclosing type with the same name, the new
15 * enclosing type will simply overwrite the older definition. <br>
16 * If the name of enclosing type is <code>null</code> the method SHOULD
17 * throw {@link IllegalArgumentException}
20 * Name of Enclosing Type
21 * @return <code>new</code> Instance of Generated Type Builder.
23 GeneratedTOBuilder addEnclosingTransferObject(final String name);
26 * Adds new Enclosing Transfer Object <code>genTOBuilder</code> into
27 * definition of Generated Type
30 * There is no need of specifying of Package Name because enclosing Type is
31 * already defined inside Generated Type with specific package name. <br>
32 * The name of enclosing Type cannot be same as Name of parent type and if
33 * there is already defined enclosing type with the same name, the new
34 * enclosing type will simply overwrite the older definition. <br>
35 * If the parameter <code>genTOBuilder</code> of enclosing type is
36 * <code>null</code> the method SHOULD throw
37 * {@link IllegalArgumentException}
39 * @param <code>genTOBuilder</code> Name of Enclosing Type
41 T addEnclosingTransferObject(final GeneratedTOBuilder genTOBuilder);
44 * Adds String definition of comment into Method Signature definition. <br>
45 * The comment String MUST NOT contain anny comment specific chars (i.e.
46 * "/**" or "//") just plain String text description.
51 T addComment(final String comment);
54 * The method creates new AnnotationTypeBuilder containing specified package
55 * name an annotation name. <br>
56 * Neither the package name or annotation name can contain <code>null</code>
57 * references. In case that any of parameters contains <code>null</code> the
58 * method SHOULD thrown {@link IllegalArgumentException}
61 * Package Name of Annotation Type
63 * Name of Annotation Type
64 * @return <code>new</code> instance of Annotation Type Builder.
66 AnnotationTypeBuilder addAnnotation(final String packageName, final String name);
69 * Sets the <code>abstract</code> flag to define Generated Type as
70 * <i>abstract</i> type.
75 T setAbstract(boolean isAbstract);
78 * Add Type to implements.
82 * @return <code>true</code> if the addition of type is successful.
84 T addImplementsType(final Type genType);
87 * Adds Constant definition and returns <code>new</code> Constant instance. <br>
88 * By definition Constant MUST be defined by return Type, Name and assigned
89 * value. The name SHOULD be defined with capital letters. Neither of method
90 * parameters can be <code>null</code> and the method SHOULD throw
91 * {@link IllegalArgumentException} if the contract is broken.
99 * @return <code>new</code> Constant instance.
101 Constant addConstant(final Type type, final String name, final Object value);
104 * Adds new Enumeration definition for Generated Type Builder and returns
105 * Enum Builder for specifying all Enum parameters. <br>
106 * If there is already Enumeration stored with the same name, the old enum
107 * will be simply overwritten byt new enum definition. <br>
108 * Name of Enumeration cannot be <code>null</code>, if it is
109 * <code>null</code> the method SHOULD throw
110 * {@link IllegalArgumentException}
114 * @return <code>new</code> instance of Enumeration Builder.
116 EnumBuilder addEnumeration(final String name);
119 * Add new Method Signature definition for Generated Type Builder and
120 * returns Method Signature Builder for specifying all Method parameters. <br>
121 * Name of Method cannot be <code>null</code>, if it is <code>null</code>
122 * the method SHOULD throw {@link IllegalArgumentException} <br>
123 * By <i>Default</i> the MethodSignatureBuilder SHOULD be pre-set as
124 * {@link MethodSignatureBuilder#setAbstract(true)},
125 * {@link MethodSignatureBuilder#setFinal(false)} and
126 * {@link MethodSignatureBuilder#setAccessModifier(PUBLIC)}
130 * @return <code>new</code> instance of Method Signature Builder.
132 MethodSignatureBuilder addMethod(final String name);
135 * Checks if GeneratedTypeBuilder contains method with name
136 * <code>methodName</code>
141 boolean containsMethod(final String methodName);
144 * Add new Generated Property definition for Generated Transfer Object
145 * Builder and returns Generated Property Builder for specifying Property. <br>
146 * Name of Property cannot be <code>null</code>, if it is <code>null</code>
147 * the method SHOULD throw {@link IllegalArgumentException}
151 * @return <code>new</code> instance of Generated Property Builder.
153 GeneratedPropertyBuilder addProperty(final String name);
156 * Check whether GeneratedTOBuilder contains property with name
160 * of property which existance is checked
161 * @return true if property <code>name</code> exists in list of properties.
163 boolean containsProperty(final String name);