6 * Copyright (c) 2013 by Cisco Systems, Inc.
9 package org.opendaylight.controller.sal.binding.model.api.type.builder;
11 import org.opendaylight.controller.sal.binding.model.api.MethodSignature;
12 import org.opendaylight.controller.sal.binding.model.api.Type;
15 * Method Signature Builder serves solely for building Method Signature and
16 * returning the <code>new</code> instance of Method Signature.
18 * By definition of {@link MethodSignature} the Method in java MUST contain
19 * Name, Return Type and Access Modifier. By default the Access Modifier can
20 * be set to public. The Method Signature builder does not contain method for
21 * addName due to enforce reason that MethodSignatureBuilder SHOULD be
22 * instantiated only once with defined method name.
24 * The methods as {@link #addAnnotation(String, String)} and {@link #setComment(String)}
25 * can be used as optional because not all methods MUST contain annotation or
26 * comment definitions.
29 * @see MethodSignature
31 public interface MethodSignatureBuilder extends TypeMemberBuilder {
34 * Sets the flag for declaration of method as abstract or non abstract. If the flag <code>isAbstract == true</code>
35 * The instantiated Method Signature MUST have return value for {@link org.opendaylight.controller.sal.binding
36 * .model.api.MethodSignature#isAbstract()} also equals to <code>true</code>.
38 * @param isAbstract is abstract flag
40 public void setAbstract(boolean isAbstract);
43 * Adds Parameter into the List of method parameters. Neither the Name or
44 * Type of parameter can be <code>null</code>.
47 * In case that any of parameters are defined as <code>null</code> the
48 * method SHOULD throw an {@link IllegalArgumentException}
50 * @param type Parameter Type
51 * @param name Parameter Name
53 public void addParameter(final Type type, final String name);
56 * Returns <code>new</code> <i>immutable</i> instance of Method Signature.
58 * The <code>definingType</code> param cannot be <code>null</code>. The
59 * every method in Java MUST be declared and defined inside the scope of
60 * <code>class</code> or <code>interface</code> definition. In case that
61 * defining Type will be passed as <code>null</code> reference the method
62 * SHOULD thrown {@link IllegalArgumentException}.
64 * @param definingType Defining Type of Method Signature
65 * @return <code>new</code> <i>immutable</i> instance of Method Signature.
67 public MethodSignature toInstance(final Type definingType);