Merge "OF plugin classes must have a strict dependency on Connection Service"
[controller.git] / opendaylight / sal / yang-prototype / code-generator / binding-model-api / src / main / java / org / opendaylight / controller / sal / binding / model / api / MethodSignature.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.sal.binding.model.api;
9
10 import java.util.List;
11
12 /**
13  * The Method Signature interface contains simplified meta model for java
14  * method definition. Each method MUST be defined by name, return type,
15  * parameters and access modifier.
16  * <br>
17  * Additionally method MAY contain associated annotations and comment. By
18  * contract if method does not contain any comments or annotation definitions
19  * the {@link #getComment()} SHOULD rather return empty string and {@link
20  * #getAnnotations()} SHOULD rather return empty list than <code>null</code>
21  * values.
22  * <br>
23  * The defining Type contains the reference to Generated Type that declares
24  * Method Signature.
25  */
26 public interface MethodSignature extends TypeMember {
27
28     /**
29      * Returns <code>true</code> if the method signature is defined as abstract.
30      * <br>
31      * By default in java all method declarations in interface are defined as abstract,
32      * but the user don't need necessary to declare abstract keyword in front of each method.
33      * <br>
34      * The abstract methods are allowed in Class definitions but only when the class is declared as abstract.
35      *
36      * @return <code>true</code> if the method signature is defined as abstract.
37      */
38     public boolean isAbstract();
39
40     /**
41      * Returns the List of parameters that method declare. If the method does
42      * not contain any parameters, the method will return empty List.
43      *
44      * @return the List of parameters that method declare.
45      */
46     public List<Parameter> getParameters();
47
48     /**
49      * The Parameter interface is designed to hold the information of method
50      * Parameter(s). The parameter is defined by his Name which MUST be
51      * unique as java does not allow multiple parameters with same names for
52      * one method and Type that is associated with parameter.
53      */
54     interface Parameter {
55
56         /**
57          * Returns the parameter name.
58          *
59          * @return the parameter name.
60          */
61         public String getName();
62
63         /**
64          * Returns Type that is bounded to parameter name.
65          *
66          * @return Type that is bounded to parameter name.
67          */
68         public Type getType();
69     }
70 }