/* * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model; import java.util.Collections; import java.util.List; import java.util.Optional; import javax.lang.model.element.Modifier; public class MethodDeclaration implements Method { private final String returnType; private final String name; private final List parameters; private String javadoc = null; private final List annotations; public MethodDeclaration(String returnType, String name, List parameters) { this(returnType, name, parameters, Collections.emptyList()); } public MethodDeclaration(String returnType, String name, List parameters, List annotations) { this.returnType = returnType; this.name = name; this.parameters = parameters; this.annotations = annotations; } @Override public List getAnnotations() { return annotations; } @Override public List getThrowsExceptions() { return Collections.emptyList(); } @Override public Optional getBody() { return Optional.empty(); } @Override public String getJavadoc() { return javadoc; } public void setJavadoc(String javadoc) { this.javadoc = javadoc; } @Override public Optional getVisibility() { return Optional.empty(); } @Override public String getReturnType() { return returnType; } @Override public String getName() { return name; } @Override public List getParameters() { return parameters; } @Override public List getModifiers() { return Collections.emptyList(); } @Override public String toString() { return MethodSerializer.toString(this); } }