de.flapdoodle.soapy.config.MethodAliasBuilder.java Source code

Java tutorial

Introduction

Here is the source code for de.flapdoodle.soapy.config.MethodAliasBuilder.java

Source

/**
 * Copyright (C) 2013
 *   Michael Mosmann <michael@mosmann.de>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/**
 * This class has been generated by Fast Code Eclipse Plugin 
 * For more information please go to http://fast-code.sourceforge.net/
 * @author : mosmann
 * Created : 06/22/2014 07:46:59
 */
package de.flapdoodle.soapy.config;

import com.google.common.base.Optional;

public class MethodAliasBuilder {
    private Name<MethodAlias> name;
    private Name<Method> sourceMethod;
    private Optional<TypeAlias> request = Optional.absent();
    private Optional<TypeAlias> response = Optional.absent();

    public MethodAliasBuilder name(String name) {
        this.name = Name.of(MethodAlias.class, name);
        return this;
    }

    public MethodAliasBuilder sourceMethod(Name<Method> sourceMethod) {
        this.sourceMethod = sourceMethod;
        return this;
    }

    public MethodAliasBuilder request(TypeAlias request) {
        this.request = Optional.of(request);
        return this;
    }

    public MethodAliasBuilder response(TypeAlias response) {
        this.response = Optional.of(response);
        return this;
    }

    public MethodAlias build() {
        return new MethodAlias(name, sourceMethod, request, response);
    }
}