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.GeneratedType;
5 import org.opendaylight.yangtools.sal.binding.model.api.Type;
7 public interface GeneratedTypeBuilderBase <T extends GeneratedTypeBuilderBase<T>> extends Type {
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}
21 * Name of Enclosing Type
22 * @return <code>new</code> Instance of Generated Type Builder.
24 public GeneratedTOBuilder addEnclosingTransferObject(final String name);
27 * Adds new Enclosing Transfer Object <code>genTOBuilder</code> into
28 * definition of Generated Type
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}
40 * @param <code>genTOBuilder</code> Name of Enclosing Type
42 public T addEnclosingTransferObject(final GeneratedTOBuilder genTOBuilder);
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.
52 public T addComment(final String comment);
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}
62 * Package Name of Annotation Type
64 * Name of Annotation Type
65 * @return <code>new</code> instance of Annotation Type Builder.
67 public AnnotationTypeBuilder addAnnotation(final String packageName, final String name);
70 * Sets the <code>abstract</code> flag to define Generated Type as
71 * <i>abstract</i> type.
76 public T setAbstract(boolean isAbstract);
79 * Add Type to implements.
83 * @return <code>true</code> if the addition of type is successful.
85 public T addImplementsType(final Type genType);
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.
100 * @return <code>new</code> Constant instance.
102 public Constant addConstant(final Type type, final String name, final Object value);
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}
115 * @return <code>new</code> instance of Enumeration Builder.
117 public EnumBuilder addEnumeration(final String name);
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)}
131 * @return <code>new</code> instance of Method Signature Builder.
133 public MethodSignatureBuilder addMethod(final String name);
136 * Checks if GeneratedTypeBuilder contains method with name
137 * <code>methodName</code>
142 public boolean containsMethod(final String methodName);
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}
152 * @return <code>new</code> instance of Generated Property Builder.
154 public GeneratedPropertyBuilder addProperty(final String name);
157 * Check whether GeneratedTOBuilder contains property with name
161 * of property which existance is checked
162 * @return true if property <code>name</code> exists in list of properties.
164 public boolean containsProperty(final String name);