2 * Copyright (c) 2013 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.controller.sal.binding.model.api.type.builder;
10 import org.opendaylight.controller.sal.binding.model.api.Constant;
11 import org.opendaylight.controller.sal.binding.model.api.GeneratedType;
12 import org.opendaylight.controller.sal.binding.model.api.Type;
15 * Generated Type Builder interface is helper interface for building and
16 * defining the GeneratedType.
20 public interface GeneratedTypeBuilder extends Type {
23 * Adds new Enclosing Type into definition of Generated Type and returns
24 * <code>new</code> Instance of Generated Type Builder. <br>
25 * There is no need of specifying of Package Name because enclosing Type is
26 * already defined inside Generated Type with specific package name. <br>
27 * The name of enclosing Type cannot be same as Name of parent type and if
28 * there is already defined enclosing type with the same name, the new
29 * enclosing type will simply overwrite the older definition. <br>
30 * If the name of enclosing type is <code>null</code> the method SHOULD
31 * throw {@link IllegalArgumentException}
34 * Name of Enclosing Type
35 * @return <code>new</code> Instance of Generated Type Builder.
37 public GeneratedTypeBuilder addEnclosingType(final String name);
40 * Adds new Enclosing Transfer Object into definition of Generated Type and
41 * returns <code>new</code> Instance of Generated TO Builder. <br>
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 name of enclosing type is <code>null</code> the method SHOULD
48 * throw {@link IllegalArgumentException}
51 * Name of Enclosing Type
52 * @return <code>new</code> Instance of Generated Type Builder.
54 public GeneratedTOBuilder addEnclosingTransferObject(final String name);
57 * Adds new Enclosing Transfer Object <code>genTOBuilder</code> into
58 * definition of Generated Type
61 * There is no need of specifying of Package Name because enclosing Type is
62 * already defined inside Generated Type with specific package name. <br>
63 * The name of enclosing Type cannot be same as Name of parent type and if
64 * there is already defined enclosing type with the same name, the new
65 * enclosing type will simply overwrite the older definition. <br>
66 * If the parameter <code>genTOBuilder</code> of enclosing type is
67 * <code>null</code> the method SHOULD throw
68 * {@link IllegalArgumentException}
70 * @param <code>genTOBuilder</code> Name of Enclosing Type
72 public void addEnclosingTransferObject(final GeneratedTOBuilder genTOBuilder);
75 * Adds String definition of comment into Method Signature definition. <br>
76 * The comment String MUST NOT contain anny comment specific chars (i.e.
77 * "/**" or "//") just plain String text description.
82 public void addComment(final String comment);
85 * The method creates new AnnotationTypeBuilder containing specified package
86 * name an annotation name. <br>
87 * Neither the package name or annotation name can contain <code>null</code>
88 * references. In case that any of parameters contains <code>null</code> the
89 * method SHOULD thrown {@link IllegalArgumentException}
92 * Package Name of Annotation Type
94 * Name of Annotation Type
95 * @return <code>new</code> instance of Annotation Type Builder.
97 public AnnotationTypeBuilder addAnnotation(final String packageName, final String name);
100 * Sets the <code>abstract</code> flag to define Generated Type as
101 * <i>abstract</i> type.
106 public void setAbstract(boolean isAbstract);
109 * Add Type to implements.
113 * @return <code>true</code> if the addition of type is successful.
115 public boolean addImplementsType(final Type genType);
118 * Adds Constant definition and returns <code>new</code> Constant instance. <br>
119 * By definition Constant MUST be defined by return Type, Name and assigned
120 * value. The name SHOULD be defined with cpaital letters. Neither of method
121 * parameters can be <code>null</code> and the method SHOULD throw
122 * {@link IllegalArgumentException} if the contract is broken.
130 * @return <code>new</code> Constant instance.
132 public Constant addConstant(final Type type, final String name, final Object value);
135 * Adds new Enumeration definition for Generated Type Builder and returns
136 * Enum Builder for specifying all Enum parameters. <br>
137 * If there is already Enumeration stored with the same name, the old enum
138 * will be simply overwritten byt new enum definition. <br>
139 * Name of Enumeration cannot be <code>null</code>, if it is
140 * <code>null</code> the method SHOULD throw
141 * {@link IllegalArgumentException}
145 * @return <code>new</code> instance of Enumeration Builder.
147 public EnumBuilder addEnumeration(final String name);
150 * Add new Method Signature definition for Generated Type Builder and
151 * returns Method Signature Builder for specifying all Method parameters. <br>
152 * Name of Method cannot be <code>null</code>, if it is <code>null</code>
153 * the method SHOULD throw {@link IllegalArgumentException} <br>
154 * By <i>Default</i> the MethodSignatureBuilder SHOULD be pre-set as
155 * {@link MethodSignatureBuilder#setAbstract(true)},
156 * {@link MethodSignatureBuilder#setFinal(false)} and
157 * {@link MethodSignatureBuilder#setAccessModifier(PUBLIC)}
161 * @return <code>new</code> instance of Method Signature Builder.
163 public MethodSignatureBuilder addMethod(final String name);
166 * Checks if GeneratedTypeBuilder contains method with name
167 * <code>methodName</code>
172 public boolean containsMethod(final String methodName);
175 * Returns the <code>new</code> <i>immutable</i> instance of Generated Type.
177 * @return the <code>new</code> <i>immutable</i> instance of Generated Type.
179 public GeneratedType toInstance();