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