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