2 * Copyright (c) 2014 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
8 package org.opendaylight.yangtools.sal.binding.model.api.type.builder;
10 import java.util.List;
11 import org.opendaylight.yangtools.sal.binding.model.api.Constant;
12 import org.opendaylight.yangtools.sal.binding.model.api.Type;
14 public interface GeneratedTypeBuilderBase<T extends GeneratedTypeBuilderBase<T>> extends Type {
17 * Adds new Enclosing Transfer Object into definition of Generated Type and
18 * returns <code>new</code> Instance of Generated TO Builder. <br>
19 * There is no need of specifying of Package Name because enclosing Type is
20 * already defined inside Generated Type with specific package name. <br>
21 * The name of enclosing Type cannot be same as Name of parent type and if
22 * there is already defined enclosing type with the same name, the new
23 * enclosing type will simply overwrite the older definition. <br>
24 * If the name of enclosing type is <code>null</code> the method SHOULD
25 * throw {@link IllegalArgumentException}
28 * Name of Enclosing Type
29 * @return <code>new</code> Instance of Generated Type Builder.
31 GeneratedTOBuilder addEnclosingTransferObject(final String name);
34 * Adds new Enclosing Transfer Object <code>genTOBuilder</code> into
35 * definition of Generated Type
38 * There is no need of specifying of Package Name because enclosing Type is
39 * already defined inside Generated Type with specific package name. <br>
40 * The name of enclosing Type cannot be same as Name of parent type and if
41 * there is already defined enclosing type with the same name, the new
42 * enclosing type will simply overwrite the older definition. <br>
43 * If the parameter <code>genTOBuilder</code> of enclosing type is
44 * <code>null</code> the method SHOULD throw
45 * {@link IllegalArgumentException}
48 * Name of Enclosing Type
50 T addEnclosingTransferObject(final GeneratedTOBuilder genTOBuilder);
53 * Adds String definition of comment into Method Signature definition. <br>
54 * The comment String MUST NOT contain anny comment specific chars (i.e.
55 * "/**" or "//") just plain String text description.
60 T addComment(final String comment);
63 * The method creates new AnnotationTypeBuilder containing specified package
64 * name an annotation name. <br>
65 * Neither the package name or annotation name can contain <code>null</code>
66 * references. In case that any of parameters contains <code>null</code> the
67 * method SHOULD thrown {@link IllegalArgumentException}
70 * Package Name of Annotation Type
72 * Name of Annotation Type
73 * @return <code>new</code> instance of Annotation Type Builder.
75 AnnotationTypeBuilder addAnnotation(final String packageName, final String name);
80 * Sets the <code>abstract</code> flag to define Generated Type as
81 * <i>abstract</i> type.
86 T setAbstract(boolean isAbstract);
88 List<Type> getImplementsTypes();
91 * Add Type to implements.
95 * @return <code>true</code> if the addition of type is successful.
97 T addImplementsType(final Type genType);
100 * Adds Constant definition and returns <code>new</code> Constant instance. <br>
101 * By definition Constant MUST be defined by return Type, Name and assigned
102 * value. The name SHOULD be defined with capital letters. Neither of method
103 * parameters can be <code>null</code> and the method SHOULD throw
104 * {@link IllegalArgumentException} if the contract is broken.
112 * @return <code>new</code> Constant instance.
114 Constant addConstant(final Type type, final String name, final Object value);
117 * Adds new Enumeration definition for Generated Type Builder and returns
118 * Enum Builder for specifying all Enum parameters. <br>
119 * If there is already Enumeration stored with the same name, the old enum
120 * will be simply overwritten byt new enum definition. <br>
121 * Name of Enumeration cannot be <code>null</code>, if it is
122 * <code>null</code> the method SHOULD throw
123 * {@link IllegalArgumentException}
127 * @return <code>new</code> instance of Enumeration Builder.
129 EnumBuilder addEnumeration(final String name);
131 List<MethodSignatureBuilder> getMethodDefinitions();
134 * Add new Method Signature definition for Generated Type Builder and
135 * returns Method Signature Builder for specifying all Method parameters. <br>
136 * Name of Method cannot be <code>null</code>, if it is <code>null</code>
137 * the method SHOULD throw {@link IllegalArgumentException} <br>
138 * By <i>Default</i> the MethodSignatureBuilder SHOULD be pre-set as
139 * {@link MethodSignatureBuilder#setAbstract(boolean)},
140 * {TypeMemberBuilder#setFinal(boolean)} and
141 * {TypeMemberBuilder#setAccessModifier(boolean)}
145 * @return <code>new</code> instance of Method Signature Builder.
147 MethodSignatureBuilder addMethod(final String name);
150 * Checks if GeneratedTypeBuilder contains method with name
151 * <code>methodName</code>
156 boolean containsMethod(final String methodName);
158 List<GeneratedPropertyBuilder> getProperties();
161 * Add new Generated Property definition for Generated Transfer Object
162 * Builder and returns Generated Property Builder for specifying Property. <br>
163 * Name of Property cannot be <code>null</code>, if it is <code>null</code>
164 * the method SHOULD throw {@link IllegalArgumentException}
168 * @return <code>new</code> instance of Generated Property Builder.
170 GeneratedPropertyBuilder addProperty(final String name);
173 * Check whether GeneratedTOBuilder contains property with name
177 * of property which existance is checked
178 * @return true if property <code>name</code> exists in list of properties.
180 boolean containsProperty(final String name);