Remove yang-test
[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 java.util.Optional;
13 import javax.lang.model.element.Modifier;
14
15 public class MethodDeclaration implements Method {
16     private final String returnType;
17     private final String name;
18     private final List<Field> parameters;
19     private String javadoc = null;
20     private final List<Annotation> annotations;
21
22     public MethodDeclaration(String returnType, String name,
23             List<Field> parameters) {
24         this(returnType, name, parameters, Collections.emptyList());
25     }
26
27     public MethodDeclaration(String returnType, String name,
28             List<Field> parameters, List<Annotation> annotations) {
29         this.returnType = returnType;
30         this.name = name;
31         this.parameters = parameters;
32         this.annotations = annotations;
33     }
34
35     @Override
36     public List<Annotation> getAnnotations() {
37         return annotations;
38     }
39
40     @Override
41     public List<String> getThrowsExceptions() {
42         return Collections.emptyList();
43     }
44
45     @Override
46     public Optional<String> getBody() {
47         return Optional.empty();
48     }
49
50     @Override
51     public String getJavadoc() {
52         return javadoc;
53     }
54
55     public void setJavadoc(String javadoc) {
56         this.javadoc = javadoc;
57     }
58
59     @Override
60     public Optional<Modifier> getVisibility() {
61         return Optional.empty();
62     }
63
64     @Override
65     public String getReturnType() {
66         return returnType;
67     }
68
69     @Override
70     public String getName() {
71         return name;
72     }
73
74     @Override
75     public List<Field> getParameters() {
76         return parameters;
77     }
78
79     @Override
80     public List<Modifier> getModifiers() {
81         return Collections.emptyList();
82     }
83
84     @Override
85     public String toString() {
86         return MethodSerializer.toString(this);
87     }
88 }