All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.sphere.sdk.extensions.HttpDestinationBuilder Maven / Gradle / Ivy

The newest version!
package io.sphere.sdk.extensions;

import io.sphere.sdk.models.Base;
import io.sphere.sdk.models.Builder;
import java.lang.String;
import javax.annotation.Generated;

/**
 * Builder for {@link HttpDestination}.
 */
@Generated(
    value = "io.sphere.sdk.annotations.processors.generators.HasBuilderGenerator",
    comments = "Generated from: io.sphere.sdk.extensions.HttpDestination"
)
public final class HttpDestinationBuilder extends Base implements Builder {
  private HttpDestinationAuthentication authentication;

  private String url;

  HttpDestinationBuilder() {
  }

  HttpDestinationBuilder(final HttpDestinationAuthentication authentication, final String url) {
    this.authentication = authentication;
    this.url = url;
  }

  /**
   * Sets the {@code authentication} property of this builder.
   *
   * @param authentication the value for {@link HttpDestination#getAuthentication()}
   * @return this builder
   */
  public HttpDestinationBuilder authentication(final HttpDestinationAuthentication authentication) {
    this.authentication = authentication;
    return this;
  }

  /**
   * Sets the {@code url} property of this builder.
   *
   * @param url the value for {@link HttpDestination#getUrl()}
   * @return this builder
   */
  public HttpDestinationBuilder url(final String url) {
    this.url = url;
    return this;
  }

  /**
   * Creates a new instance of {@code HttpDestination} with the values of this builder.
   *
   * @return the instance
   */
  public HttpDestination build() {
    return new HttpDestinationImpl(authentication, url);
  }

  /**
   * Creates a new object initialized with the given values.
   *
   * @param url initial value for the {@link HttpDestination#getUrl()} property
   * @param authentication initial value for the {@link HttpDestination#getAuthentication()} property
   * @return new object initialized with the given values
   */
  public static HttpDestinationBuilder of(final String url,
      final HttpDestinationAuthentication authentication) {
    return new HttpDestinationBuilder(authentication, url);
  }

  /**
   * Creates a new object initialized with the fields of the template parameter.
   *
   * @param template the template
   * @return a new object initialized from the template
   */
  public static HttpDestinationBuilder of(final HttpDestination template) {
    return new HttpDestinationBuilder(template.getAuthentication(), template.getUrl());
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy