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

io.sphere.sdk.carts.ItemShippingTargetBuilder Maven / Gradle / Ivy

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

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

/**
 * Builder for {@link ItemShippingTarget}.
 */
@Generated(
    value = "io.sphere.sdk.annotations.processors.generators.HasBuilderGenerator",
    comments = "Generated from: io.sphere.sdk.carts.ItemShippingTarget"
)
public final class ItemShippingTargetBuilder extends Base implements Builder {
  private String addressKey;

  private Long quantity;

  ItemShippingTargetBuilder() {
  }

  ItemShippingTargetBuilder(final String addressKey, final Long quantity) {
    this.addressKey = addressKey;
    this.quantity = quantity;
  }

  /**
   * Sets the {@code addressKey} property of this builder.
   *
   * @param addressKey the value for {@link ItemShippingTarget#getAddressKey()}
   * @return this builder
   */
  public ItemShippingTargetBuilder addressKey(final String addressKey) {
    this.addressKey = addressKey;
    return this;
  }

  /**
   * Sets the {@code quantity} property of this builder.
   *
   * @param quantity the value for {@link ItemShippingTarget#getQuantity()}
   * @return this builder
   */
  public ItemShippingTargetBuilder quantity(final Long quantity) {
    this.quantity = quantity;
    return this;
  }

  /**
   * Creates a new instance of {@code ItemShippingTarget} with the values of this builder.
   *
   * @return the instance
   */
  public ItemShippingTarget build() {
    return new ItemShippingTargetImpl(addressKey, quantity);
  }

  /**
   * Creates a new object initialized with the given values.
   *
   * @param addressKey initial value for the {@link ItemShippingTarget#getAddressKey()} property
   * @param quantity initial value for the {@link ItemShippingTarget#getQuantity()} property
   * @return new object initialized with the given values
   */
  public static ItemShippingTargetBuilder of(final String addressKey, final Long quantity) {
    return new ItemShippingTargetBuilder(addressKey, quantity);
  }

  /**
   * 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 ItemShippingTargetBuilder of(final ItemShippingTarget template) {
    return new ItemShippingTargetBuilder(template.getAddressKey(), template.getQuantity());
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy