001
002package com.commercetools.api.models.extension;
003
004import java.util.*;
005
006import io.vrap.rmf.base.client.Builder;
007import io.vrap.rmf.base.client.utils.Generated;
008
009/**
010 * GoogleCloudFunctionDestinationBuilder
011 * <hr>
012 * Example to create an instance using the builder pattern
013 * <div class=code-example>
014 * <pre><code class='java'>
015 *     GoogleCloudFunctionDestination googleCloudFunctionDestination = GoogleCloudFunctionDestination.builder()
016 *             .url("{url}")
017 *             .build()
018 * </code></pre>
019 * </div>
020 */
021@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
022public class GoogleCloudFunctionDestinationBuilder implements Builder<GoogleCloudFunctionDestination> {
023
024    private String url;
025
026    /**
027     *  <p>URL to the target function.</p>
028     * @param url value to be set
029     * @return Builder
030     */
031
032    public GoogleCloudFunctionDestinationBuilder url(final String url) {
033        this.url = url;
034        return this;
035    }
036
037    /**
038     *  <p>URL to the target function.</p>
039     * @return url
040     */
041
042    public String getUrl() {
043        return this.url;
044    }
045
046    /**
047     * builds GoogleCloudFunctionDestination with checking for non-null required values
048     * @return GoogleCloudFunctionDestination
049     */
050    public GoogleCloudFunctionDestination build() {
051        Objects.requireNonNull(url, GoogleCloudFunctionDestination.class + ": url is missing");
052        return new GoogleCloudFunctionDestinationImpl(url);
053    }
054
055    /**
056     * builds GoogleCloudFunctionDestination without checking for non-null required values
057     * @return GoogleCloudFunctionDestination
058     */
059    public GoogleCloudFunctionDestination buildUnchecked() {
060        return new GoogleCloudFunctionDestinationImpl(url);
061    }
062
063    /**
064     * factory method for an instance of GoogleCloudFunctionDestinationBuilder
065     * @return builder
066     */
067    public static GoogleCloudFunctionDestinationBuilder of() {
068        return new GoogleCloudFunctionDestinationBuilder();
069    }
070
071    /**
072     * create builder for GoogleCloudFunctionDestination instance
073     * @param template instance with prefilled values for the builder
074     * @return builder
075     */
076    public static GoogleCloudFunctionDestinationBuilder of(final GoogleCloudFunctionDestination template) {
077        GoogleCloudFunctionDestinationBuilder builder = new GoogleCloudFunctionDestinationBuilder();
078        builder.url = template.getUrl();
079        return builder;
080    }
081
082}