425f85fe25d1259e8cda5b14f91f106911ee4443
[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 import org.apache.commons.lang3.StringUtils;
13
14 public class MethodDeclaration implements Method {
15     private final String returnType;
16     private final String name;
17     private final List<Field> parameters;
18     private String javadoc = null;
19     private final List<Annotation> annotations;
20
21     public MethodDeclaration(String returnType, String name,
22             List<Field> parameters) {
23         this(returnType, name, parameters, Collections.<Annotation> emptyList());
24     }
25
26     public MethodDeclaration(String returnType, String name,
27             List<Field> parameters, List<Annotation> annotations) {
28         this.returnType = returnType;
29         this.name = name;
30         this.parameters = parameters;
31         this.annotations = annotations;
32     }
33
34     @Override
35     public List<Annotation> getAnnotations() {
36         return annotations;
37     }
38
39     @Override
40     public String getJavadoc() {
41         return javadoc;
42     }
43
44     public void setJavadoc(String javadoc) {
45         this.javadoc = javadoc;
46     }
47
48     @Override
49     public String getVisibility() {
50         return StringUtils.EMPTY;
51     }
52
53     @Override
54     public String getReturnType() {
55         return returnType;
56     }
57
58     @Override
59     public String getName() {
60         return name;
61     }
62
63     @Override
64     public List<Field> getParameters() {
65         return parameters;
66     }
67
68     @Override
69     public List<String> getModifiers() {
70         return Collections.emptyList();
71     }
72
73     @Override
74     public String toString() {
75         return MethodSerializer.toString(this);
76     }
77 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.