Merge "Bug 509: Improve logging in InMemoryDataStore."
[controller.git] / opendaylight / config / yang-jmx-generator-plugin / src / main / java / org / opendaylight / controller / config / yangjmxgenerator / plugin / ftl / model / MethodDeclaration.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.config.yangjmxgenerator.plugin.ftl.model;
9
10 import java.util.Collections;
11 import java.util.List;
12
13 public class MethodDeclaration implements Method {
14     private final String returnType;
15     private final String name;
16     private final List<Field> parameters;
17     private String javadoc = null;
18     private final List<Annotation> annotations;
19
20     public MethodDeclaration(String returnType, String name,
21             List<Field> parameters) {
22         this(returnType, name, parameters, Collections.<Annotation> emptyList());
23     }
24
25     public MethodDeclaration(String returnType, String name,
26             List<Field> parameters, List<Annotation> annotations) {
27         this.returnType = returnType;
28         this.name = name;
29         this.parameters = parameters;
30         this.annotations = annotations;
31     }
32
33     @Override
34     public List<Annotation> getAnnotations() {
35         return annotations;
36     }
37
38     @Override
39     public String getJavadoc() {
40         return javadoc;
41     }
42
43     public void setJavadoc(String javadoc) {
44         this.javadoc = javadoc;
45     }
46
47     @Override
48     public String getReturnType() {
49         return returnType;
50     }
51
52     @Override
53     public String getName() {
54         return name;
55     }
56
57     @Override
58     public List<Field> getParameters() {
59         return parameters;
60     }
61
62     @Override
63     public List<String> getModifiers() {
64         return Collections.emptyList();
65     }
66
67     @Override
68     public String toString() {
69         return MethodSerializer.toString(this);
70     }
71 }