2 * Copyright (c) 2017 Cisco Systems, Inc. and others. All rights reserved.
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
9 package org.opendaylight.mdsal.binding.javav2.model.api.type.builder;
11 import com.google.common.annotations.Beta;
12 import java.util.List;
13 import org.opendaylight.mdsal.binding.javav2.generator.context.ModuleContext;
14 import org.opendaylight.mdsal.binding.javav2.model.api.Constant;
15 import org.opendaylight.mdsal.binding.javav2.model.api.Type;
16 import org.opendaylight.yangtools.yang.common.QName;
19 public interface GeneratedTypeBuilderBase<T extends GeneratedTypeBuilderBase<T>> extends Type {
22 * Adds new Enclosing Transfer Object into definition of Generated Type and
23 * returns <code>new</code> Instance of Generated TO Builder. <br>
24 * There is no need of specifying of Package Name because enclosing Type is
25 * already defined inside Generated Type with specific package name. <br>
26 * The name of enclosing Type cannot be same as Name of parent type and if
27 * there is already defined enclosing type with the same name, the new
28 * enclosing type will simply overwrite the older definition. <br>
29 * If the name of enclosing type is <code>null</code> the method SHOULD
30 * throw {@link IllegalArgumentException}
33 * Name of Enclosing Type
34 * @return <code>new</code> Instance of Generated Type Builder.
36 GeneratedTOBuilder addEnclosingTransferObject(String name);
39 * Adds new Enclosing Transfer Object <code>genTOBuilder</code> into
40 * definition of Generated Type
43 * There is no need of specifying of Package Name because enclosing Type is
44 * already defined inside Generated Type with specific package name. <br>
45 * The name of enclosing Type cannot be same as Name of parent type and if
46 * there is already defined enclosing type with the same name, the new
47 * enclosing type will simply overwrite the older definition. <br>
48 * If the parameter <code>genTOBuilder</code> of enclosing type is
49 * <code>null</code> the method SHOULD throw
50 * {@link IllegalArgumentException}
53 * Name of Enclosing Type
55 T addEnclosingTransferObject(GeneratedTOBuilder genTOBuilder);
58 * Adds String definition of comment into Method Signature definition. <br>
59 * The comment String MUST NOT contain anny comment specific chars (i.e.
60 * "/**" or "//") just plain String text description.
65 T addComment(String comment);
68 * The method creates new AnnotationTypeBuilder containing specified package
69 * name an annotation name. <br>
70 * Neither the package name or annotation name can contain <code>null</code>
71 * references. In case that any of parameters contains <code>null</code> the
72 * method SHOULD thrown {@link IllegalArgumentException}
75 * Package Name of Annotation Type
77 * Name of Annotation Type
78 * @return <code>new</code> instance of Annotation Type Builder.
80 AnnotationTypeBuilder addAnnotation(String packageName, String name);
85 * Sets the <code>abstract</code> flag to define Generated Type as
86 * <i>abstract</i> type.
91 T setAbstract(boolean isAbstract);
93 List<Type> getImplementsTypes();
96 * Add Type to implements.
100 * @return <code>true</code> if the addition of type is successful.
102 T addImplementsType(Type genType);
105 * Adds Constant definition and returns <code>new</code> Constant instance. <br>
106 * By definition Constant MUST be defined by return Type, Name and assigned
107 * value. The name SHOULD be defined with capital letters. Neither of method
108 * parameters can be <code>null</code> and the method SHOULD throw
109 * {@link IllegalArgumentException} if the contract is broken.
117 * @return <code>new</code> Constant instance.
119 Constant addConstant(Type type, String name, Object value);
122 * Adds new Enumeration definition for Generated Type Builder and returns
123 * Enum Builder for specifying all Enum parameters. <br>
124 * If there is already Enumeration stored with the same name, the old enum
125 * will be simply overwritten byt new enum definition. <br>
126 * Name of Enumeration cannot be <code>null</code>, if it is
127 * <code>null</code> the method SHOULD throw
128 * {@link IllegalArgumentException}
132 * @return <code>new</code> instance of Enumeration Builder.
134 EnumBuilder addEnumeration(String name, ModuleContext context);
137 * Sets parent type for data schema node node builder
139 * @param type generated parent type
140 * @return generated type
142 Type setParentTypeForBuilder(Type type);
144 List<MethodSignatureBuilder> getMethodDefinitions();
147 * Add new Method Signature definition for Generated Type Builder and
148 * returns Method Signature Builder for specifying all Method parameters. <br>
149 * Name of Method cannot be <code>null</code>, if it is <code>null</code>
150 * the method SHOULD throw {@link IllegalArgumentException} <br>
151 * By <i>Default</i> the MethodSignatureBuilder SHOULD be pre-set as
152 * {@link MethodSignatureBuilder#setAbstract(boolean)},
153 * {TypeMemberBuilder#setFinal(boolean)} and
154 * {TypeMemberBuilder#setAccessModifier(boolean)}
158 * @return <code>new</code> instance of Method Signature Builder.
160 MethodSignatureBuilder addMethod(String name);
163 * Checks if GeneratedTypeBuilder contains method with name
164 * <code>methodName</code>
169 boolean containsMethod(String methodName);
171 List<GeneratedPropertyBuilder> getProperties();
174 * Add new Generated Property definition for Generated Transfer Object
175 * Builder and returns Generated Property Builder for specifying Property. <br>
176 * Name of Property cannot be <code>null</code>, if it is <code>null</code>
177 * the method SHOULD throw {@link IllegalArgumentException}
181 * @return <code>new</code> instance of Generated Property Builder.
183 GeneratedPropertyBuilder addProperty(String name);
186 * Check whether GeneratedTOBuilder contains property with name
190 * of property which existance is checked
191 * @return true if property <code>name</code> exists in list of properties.
193 boolean containsProperty(String name);
196 * Set a string that contains a human-readable textual description of type
200 * a string that contains a human-readable textual description of
203 void setDescription(String description);
206 * Set the name of the module, in which generated type was specified.
209 * the name of the module
211 void setModuleName(String moduleName);
214 * Set a list of QNames which represent schema path in schema tree from
215 * actual concrete type to the root.
218 * a list of QNames which represent schema path in schema tree
220 void setSchemaPath(List<QName> schemaPath);
223 * Set a string that is used to specify a textual cross-reference to an
224 * external document, either another module that defines related management
225 * information, or a document that provides additional information relevant
226 * to this definition.
229 * a textual cross-reference to an external document.
231 void setReference(String reference);