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.
26 * There is no need of specifying of Package Name because enclosing Type
27 * is already defined inside Generated Type with specific package name.
29 * The name of enclosing Type cannot be same as Name of parent type and
30 * if there is already defined enclosing type with the same name,
31 * the new enclosing type will simply overwrite the older definition.
33 * If the name of enclosing type is <code>null</code> the method SHOULD
34 * throw {@link IllegalArgumentException}
36 * @param name Name of Enclosing Type
37 * @return <code>new</code> Instance of Generated Type Builder.
39 public GeneratedTypeBuilder addEnclosingType(final String name);
42 * Adds new Enclosing Transfer Object into definition of Generated Type
43 * and returns <code>new</code> Instance of Generated TO Builder.
45 * There is no need of specifying of Package Name because enclosing Type
46 * is already defined inside Generated Type with specific package name.
48 * The name of enclosing Type cannot be same as Name of parent type and
49 * if there is already defined enclosing type with the same name,
50 * the new enclosing type will simply overwrite the older definition.
52 * If the name of enclosing type is <code>null</code> the method SHOULD
53 * throw {@link IllegalArgumentException}
55 * @param name Name of Enclosing Type
56 * @return <code>new</code> Instance of Generated Type Builder.
58 public GeneratedTOBuilder addEnclosingTransferObject(final String name);
61 * Adds String definition of comment into Method Signature definition.
63 * The comment String MUST NOT contain anny comment specific chars (i.e.
64 * "/**" or "//") just plain String text description.
66 * @param comment Comment String.
68 public void addComment(final String comment);
71 * The method creates new AnnotationTypeBuilder containing specified
72 * package name an annotation name.
74 * Neither the package name or annotation name can contain
75 * <code>null</code> references. In case that
76 * any of parameters contains <code>null</code> the method SHOULD thrown
77 * {@link IllegalArgumentException}
79 * @param packageName Package Name of Annotation Type
80 * @param name Name of Annotation Type
81 * @return <code>new</code> instance of Annotation Type Builder.
83 public AnnotationTypeBuilder addAnnotation(final String packageName, final String name);
86 * Sets the <code>abstract</code> flag to define Generated Type as <i>abstract</i> type.
88 * @param isAbstract abstract flag
90 public void setAbstract(boolean isAbstract);
93 * Add Type to implements.
95 * @param genType Type to implement
96 * @return <code>true</code> if the addition of type is successful.
98 public boolean addImplementsType(final Type genType);
101 * Adds Constant definition and returns <code>new</code> Constant instance.
103 * By definition Constant MUST be defined by return Type,
104 * Name and assigned value. The name SHOULD be defined with cpaital
105 * letters. Neither of method parameters can be <code>null</code> and the
106 * method SHOULD throw {@link IllegalArgumentException} if the contract
109 * @param type Constant Type
110 * @param name Name of Constant
111 * @param value Assigned Value
112 * @return <code>new</code> Constant instance.
114 public Constant addConstant(final Type type, final String name,
118 * Adds new Enumeration definition for Generated Type Builder and returns
119 * Enum Builder for specifying all Enum parameters.
121 * If there is already Enumeration stored with the same name,
122 * the old enum will be simply overwritten byt new enum definition.
124 * Name of Enumeration cannot be <code>null</code>,
125 * if it is <code>null</code> the method SHOULD throw {@link IllegalArgumentException}
127 * @param name Enumeration Name
128 * @return <code>new</code> instance of Enumeration Builder.
130 public EnumBuilder addEnumeration(final String name);
133 * Add new Method Signature definition for Generated Type Builder and
134 * returns Method Signature Builder for specifying all Method parameters.
136 * Name of Method cannot be <code>null</code>,
137 * if it is <code>null</code> the method SHOULD throw {@link IllegalArgumentException}
139 * By <i>Default</i> the MethodSignatureBuilder SHOULD be pre-set as
140 * {@link MethodSignatureBuilder#setAbstract(true)}, {@link MethodSignatureBuilder#setFinal(false)} and
141 * {@link MethodSignatureBuilder#setAccessModifier(PUBLIC)}
143 * @param name Name of Method
144 * @return <code>new</code> instance of Method Signature Builder.
146 public MethodSignatureBuilder addMethod(final String name);
149 * Returns the <code>new</code> <i>immutable</i> instance of Generated
152 * @return the <code>new</code> <i>immutable</i> instance of Generated
155 public GeneratedType toInstance();