2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model;
10 import java.util.Collections;
11 import java.util.List;
12 import java.util.Optional;
13 import javax.lang.model.element.Modifier;
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;
22 public MethodDeclaration(String returnType, String name,
23 List<Field> parameters) {
24 this(returnType, name, parameters, Collections.emptyList());
27 public MethodDeclaration(String returnType, String name,
28 List<Field> parameters, List<Annotation> annotations) {
29 this.returnType = returnType;
31 this.parameters = parameters;
32 this.annotations = annotations;
36 public List<Annotation> getAnnotations() {
41 public List<String> getThrowsExceptions() {
42 return Collections.emptyList();
46 public Optional<String> getBody() {
47 return Optional.empty();
51 public String getJavadoc() {
55 public void setJavadoc(String javadoc) {
56 this.javadoc = javadoc;
60 public Optional<Modifier> getVisibility() {
61 return Optional.empty();
65 public String getReturnType() {
70 public String getName() {
75 public List<Field> getParameters() {
80 public List<Modifier> getModifiers() {
81 return Collections.emptyList();
85 public String toString() {
86 return MethodSerializer.toString(this);