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

io.sphere.sdk.zones.ZoneDraftBuilder Maven / Gradle / Ivy

There is a newer version: 2.16.0
Show newest version
package io.sphere.sdk.zones;

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

/**
 * Builder for {@link ZoneDraft}.
 */
@Generated(
    value = "io.sphere.sdk.annotations.processors.generators.DraftBuilderGenerator",
    comments = "Generated from: io.sphere.sdk.zones.ZoneDraft"
)
public final class ZoneDraftBuilder extends Base implements Builder {
  @Nullable
  private String description;

  private Set locations;

  private String name;

  ZoneDraftBuilder() {
  }

  ZoneDraftBuilder(@Nullable final String description, final Set locations,
      final String name) {
    this.description = description;
    this.locations = locations;
    this.name = name;
  }

  /**
   * Sets the {@code description} property of this builder.
   *
   * @param description the value for {@link ZoneDraft#getDescription()}
   * @return this builder
   */
  public ZoneDraftBuilder description(@Nullable final String description) {
    this.description = description;
    return this;
  }

  /**
   * Sets the {@code locations} property of this builder.
   *
   * @param locations the value for {@link ZoneDraft#getLocations()}
   * @return this builder
   */
  public ZoneDraftBuilder locations(final Set locations) {
    this.locations = locations;
    return this;
  }

  /**
   * Sets the {@code name} property of this builder.
   *
   * @param name the value for {@link ZoneDraft#getName()}
   * @return this builder
   */
  public ZoneDraftBuilder name(final String name) {
    this.name = name;
    return this;
  }

  /**
   * Creates a new instance of {@code ZoneDraftDsl} with the values of this builder.
   *
   * @return the instance
   */
  public ZoneDraftDsl build() {
    return new ZoneDraftDsl(description, locations, name);
  }

  /**
   * Creates a builder initialized with the given values.
   *
   * @param name initial value for the {@link ZoneDraft#getName()} property
   * @param locations initial value for the {@link ZoneDraft#getLocations()} property
   * @param description initial value for the {@link ZoneDraft#getDescription()} property
   * @return new builder initialized with the given values
   */
  public static ZoneDraftBuilder of(final String name, final Set locations,
      final String description) {
    return new ZoneDraftBuilder(description, locations, name);
  }

  /**
   * Creates a builder initialized with the given values.
   *
   * @param name initial value for the {@link ZoneDraft#getName()} property
   * @param locations initial value for the {@link ZoneDraft#getLocations()} property
   * @return new builder initialized with the given values
   */
  public static ZoneDraftBuilder of(final String name, final Set locations) {
    return new ZoneDraftBuilder(null, locations, name);
  }

  /**
   * Creates a builder initialized with the fields of the template parameter.
   *
   * @param template the template
   * @return a new builder initialized from the template
   */
  public static ZoneDraftBuilder of(final ZoneDraft template) {
    return new ZoneDraftBuilder(template.getDescription(), template.getLocations(), template.getName());
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy