Rename applySubtreeChange()
[yangtools.git] / code-generator / binding-model-api / src / main / java / org / opendaylight / yangtools / sal / binding / model / api / type / builder / MethodSignatureBuilder.java
1 /**
2
3  *
4  * March 2013
5  *
6  * Copyright (c) 2013 by Cisco Systems, Inc.
7  * All rights reserved.
8  */
9 package org.opendaylight.yangtools.sal.binding.model.api.type.builder;
10
11 import org.opendaylight.yangtools.sal.binding.model.api.MethodSignature;
12 import org.opendaylight.yangtools.sal.binding.model.api.Type;
13
14 /**
15  * Method Signature Builder serves solely for building Method Signature and
16  * returning the <code>new</code> instance of Method Signature. <br>
17  * By definition of {@link MethodSignature} the Method in java MUST contain
18  * Name, Return Type and Access Modifier. By default the Access Modifier can be
19  * set to public. The Method Signature builder does not contain method for
20  * addName due to enforce reason that MethodSignatureBuilder SHOULD be
21  * instantiated only once with defined method name. <br>
22  * The methods as {@link #addAnnotation(String, String)} and
23  * {@link #setComment(String)} can be used as optional because not all methods
24  * MUST contain annotation or comment definitions.
25  * 
26  * 
27  * @see MethodSignature
28  */
29 public interface MethodSignatureBuilder extends TypeMemberBuilder<MethodSignatureBuilder> {
30
31     /**
32      * Sets the flag for declaration of method as abstract or non abstract. If
33      * the flag <code>isAbstract == true</code> The instantiated Method
34      * Signature MUST have return value for {@link MethodSignature#isAbstract()}
35      * also equals to <code>true</code>.
36      * 
37      * @param isAbstract
38      *            is abstract flag
39      */
40     MethodSignatureBuilder setAbstract(boolean isAbstract);
41
42     /**
43      * Adds Parameter into the List of method parameters. Neither the Name or
44      * Type of parameter can be <code>null</code>.
45      * 
46      * <br>
47      * In case that any of parameters are defined as <code>null</code> the
48      * method SHOULD throw an {@link IllegalArgumentException}
49      * 
50      * @param type
51      *            Parameter Type
52      * @param name
53      *            Parameter Name
54      */
55     MethodSignatureBuilder addParameter(final Type type, final String name);
56
57     /**
58      * Returns <code>new</code> <i>immutable</i> instance of Method Signature. <br>
59      * The <code>definingType</code> param cannot be <code>null</code>. The
60      * every method in Java MUST be declared and defined inside the scope of
61      * <code>class</code> or <code>interface</code> definition. In case that
62      * defining Type will be passed as <code>null</code> reference the method
63      * SHOULD thrown {@link IllegalArgumentException}.
64      * 
65      * @param definingType
66      *            Defining Type of Method Signature
67      * @return <code>new</code> <i>immutable</i> instance of Method Signature.
68      */
69     MethodSignature toInstance(final Type definingType);
70 }