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

io.sphere.sdk.shippingmethods.ZoneRateDraftDsl Maven / Gradle / Ivy

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

import com.fasterxml.jackson.annotation.JsonCreator;
import io.sphere.sdk.models.Base;
import io.sphere.sdk.models.ResourceIdentifier;
import io.sphere.sdk.zones.Zone;
import java.util.List;
import javax.annotation.Generated;

/**
 * Dsl class for {@link ZoneRateDraft}.
 */
@Generated(
    value = "io.sphere.sdk.annotations.processors.generators.ResourceDraftValueGenerator",
    comments = "Generated from: io.sphere.sdk.shippingmethods.ZoneRateDraft"
)
public final class ZoneRateDraftDsl extends Base implements ZoneRateDraft {
  private List shippingRates;

  private ResourceIdentifier zone;

  @JsonCreator
  ZoneRateDraftDsl(final List shippingRates, final ResourceIdentifier zone) {
    this.shippingRates = shippingRates;
    this.zone = zone;
  }

  public List getShippingRates() {
    return shippingRates;
  }

  public ResourceIdentifier getZone() {
    return zone;
  }

  /**
   * Creates a new builder with the values of this object.
   *
   * @return new builder
   */
  public ZoneRateDraftBuilder newBuilder() {
    return new ZoneRateDraftBuilder(shippingRates, zone);
  }

  public ZoneRateDraftDsl withShippingRates(final List shippingRates) {
    return newBuilder().shippingRates(shippingRates).build();
  }

  public ZoneRateDraftDsl withZone(final ResourceIdentifier zone) {
    return newBuilder().zone(zone).build();
  }

  /**
   * Creates a new object initialized with the given values.
   *
   * @param zone initial value for the {@link ZoneRateDraft#getZone()} property
   * @param shippingRates initial value for the {@link ZoneRateDraft#getShippingRates()} property
   * @return new object initialized with the given values
   */
  public static ZoneRateDraftDsl of(final ResourceIdentifier zone,
      final List shippingRates) {
    return new ZoneRateDraftDsl(shippingRates, zone);
  }

  /**
   * 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 ZoneRateDraftDsl of(final ZoneRateDraft template) {
    return new ZoneRateDraftDsl(template.getShippingRates(), template.getZone());
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy