2 * Copyright (c) 2016 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.binding2.model.api.type.builder;
11 import com.google.common.annotations.Beta;
12 import java.util.List;
13 import org.opendaylight.mdsal.binding2.model.api.Constant;
14 import org.opendaylight.mdsal.binding2.model.api.Type;
15 import org.opendaylight.yangtools.yang.common.QName;
18 public interface GeneratedTypeBuilderBase<T extends GeneratedTypeBuilderBase<T>> extends Type {
21 * Adds new Enclosing Transfer Object into definition of Generated Type and
22 * returns <code>new</code> Instance of Generated TO Builder. <br>
23 * There is no need of specifying of Package Name because enclosing Type is
24 * already defined inside Generated Type with specific package name. <br>
25 * The name of enclosing Type cannot be same as Name of parent type and if
26 * there is already defined enclosing type with the same name, the new
27 * enclosing type will simply overwrite the older definition. <br>
28 * If the name of enclosing type is <code>null</code> the method SHOULD
29 * throw {@link IllegalArgumentException}
32 * Name of Enclosing Type
33 * @return <code>new</code> Instance of Generated Type Builder.
35 GeneratedTOBuilder addEnclosingTransferObject(String name);
38 * Adds new Enclosing Transfer Object <code>genTOBuilder</code> into
39 * definition of Generated Type
42 * There is no need of specifying of Package Name because enclosing Type is
43 * already defined inside Generated Type with specific package name. <br>
44 * The name of enclosing Type cannot be same as Name of parent type and if
45 * there is already defined enclosing type with the same name, the new
46 * enclosing type will simply overwrite the older definition. <br>
47 * If the parameter <code>genTOBuilder</code> of enclosing type is
48 * <code>null</code> the method SHOULD throw
49 * {@link IllegalArgumentException}
52 * Name of Enclosing Type
54 T addEnclosingTransferObject(GeneratedTOBuilder genTOBuilder);
57 * Adds String definition of comment into Method Signature definition. <br>
58 * The comment String MUST NOT contain anny comment specific chars (i.e.
59 * "/**" or "//") just plain String text description.
64 T addComment(String comment);
67 * The method creates new AnnotationTypeBuilder containing specified package
68 * name an annotation name. <br>
69 * Neither the package name or annotation name can contain <code>null</code>
70 * references. In case that any of parameters contains <code>null</code> the
71 * method SHOULD thrown {@link IllegalArgumentException}
74 * Package Name of Annotation Type
76 * Name of Annotation Type
77 * @return <code>new</code> instance of Annotation Type Builder.
79 AnnotationTypeBuilder addAnnotation(String packageName, String name);
84 * Sets the <code>abstract</code> flag to define Generated Type as
85 * <i>abstract</i> type.
90 T setAbstract(boolean isAbstract);
92 List<Type> getImplementsTypes();
95 * Add Type to implements.
99 * @return <code>true</code> if the addition of type is successful.
101 T addImplementsType(Type genType);
104 * Adds Constant definition and returns <code>new</code> Constant instance. <br>
105 * By definition Constant MUST be defined by return Type, Name and assigned
106 * value. The name SHOULD be defined with capital letters. Neither of method
107 * parameters can be <code>null</code> and the method SHOULD throw
108 * {@link IllegalArgumentException} if the contract is broken.
116 * @return <code>new</code> Constant instance.
118 Constant addConstant(Type type, String name, Object value);
121 * Adds new Enumeration definition for Generated Type Builder and returns
122 * Enum Builder for specifying all Enum parameters. <br>
123 * If there is already Enumeration stored with the same name, the old enum
124 * will be simply overwritten byt new enum definition. <br>
125 * Name of Enumeration cannot be <code>null</code>, if it is
126 * <code>null</code> the method SHOULD throw
127 * {@link IllegalArgumentException}
131 * @return <code>new</code> instance of Enumeration Builder.
133 EnumBuilder addEnumeration(String name);
135 List<MethodSignatureBuilder> getMethodDefinitions();
138 * Add new Method Signature definition for Generated Type Builder and
139 * returns Method Signature Builder for specifying all Method parameters. <br>
140 * Name of Method cannot be <code>null</code>, if it is <code>null</code>
141 * the method SHOULD throw {@link IllegalArgumentException} <br>
142 * By <i>Default</i> the MethodSignatureBuilder SHOULD be pre-set as
143 * {@link MethodSignatureBuilder#setAbstract(boolean)},
144 * {TypeMemberBuilder#setFinal(boolean)} and
145 * {TypeMemberBuilder#setAccessModifier(boolean)}
149 * @return <code>new</code> instance of Method Signature Builder.
151 MethodSignatureBuilder addMethod(String name);
154 * Checks if GeneratedTypeBuilder contains method with name
155 * <code>methodName</code>
160 boolean containsMethod(String methodName);
162 List<GeneratedPropertyBuilder> getProperties();
165 * Add new Generated Property definition for Generated Transfer Object
166 * Builder and returns Generated Property Builder for specifying Property. <br>
167 * Name of Property cannot be <code>null</code>, if it is <code>null</code>
168 * the method SHOULD throw {@link IllegalArgumentException}
172 * @return <code>new</code> instance of Generated Property Builder.
174 GeneratedPropertyBuilder addProperty(String name);
177 * Check whether GeneratedTOBuilder contains property with name
181 * of property which existance is checked
182 * @return true if property <code>name</code> exists in list of properties.
184 boolean containsProperty(String name);
187 * Set a string that contains a human-readable textual description of type
191 * a string that contains a human-readable textual description of
194 void setDescription(String description);
197 * Set the name of the module, in which generated type was specified.
200 * the name of the module
202 void setModuleName(String moduleName);
205 * Set a list of QNames which represent schema path in schema tree from
206 * actual concrete type to the root.
209 * a list of QNames which represent schema path in schema tree
211 void setSchemaPath(Iterable<QName> schemaPath);
214 * Set a string that is used to specify a textual cross-reference to an
215 * external document, either another module that defines related management
216 * information, or a document that provides additional information relevant
217 * to this definition.
220 * a textual cross-reference to an external document.
222 void setReference(String reference);