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

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

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

import io.sphere.sdk.models.Base;
import io.sphere.sdk.models.Builder;
import io.sphere.sdk.taxcategories.ExternalTaxRateDraft;
import javax.annotation.Generated;
import javax.money.MonetaryAmount;

/**
 * Builder for {@link ExternalTaxAmountDraft}.
 */
@Generated(
    value = "io.sphere.sdk.annotations.processors.generators.DraftBuilderGenerator",
    comments = "Generated from: io.sphere.sdk.carts.ExternalTaxAmountDraft"
)
public final class ExternalTaxAmountDraftBuilder extends Base implements Builder {
  private ExternalTaxRateDraft taxRate;

  private MonetaryAmount totalGross;

  ExternalTaxAmountDraftBuilder() {
  }

  ExternalTaxAmountDraftBuilder(final ExternalTaxRateDraft taxRate,
      final MonetaryAmount totalGross) {
    this.taxRate = taxRate;
    this.totalGross = totalGross;
  }

  /**
   * Sets the {@code taxRate} property of this builder.
   *
   * @param taxRate the value for {@link ExternalTaxAmountDraft#getTaxRate()}
   * @return this builder
   */
  public ExternalTaxAmountDraftBuilder taxRate(final ExternalTaxRateDraft taxRate) {
    this.taxRate = taxRate;
    return this;
  }

  /**
   * Sets the {@code totalGross} property of this builder.
   *
   * @param totalGross the value for {@link ExternalTaxAmountDraft#getTotalGross()}
   * @return this builder
   */
  public ExternalTaxAmountDraftBuilder totalGross(final MonetaryAmount totalGross) {
    this.totalGross = totalGross;
    return this;
  }

  public ExternalTaxRateDraft getTaxRate() {
    return taxRate;
  }

  public MonetaryAmount getTotalGross() {
    return totalGross;
  }

  /**
   * Creates a new instance of {@code ExternalTaxAmountDraftDsl} with the values of this builder.
   *
   * @return the instance
   */
  public ExternalTaxAmountDraftDsl build() {
    return new ExternalTaxAmountDraftDsl(taxRate, totalGross);
  }

  /**
   * Creates a new object initialized with the given values.
   *
   * @param totalGross initial value for the {@link ExternalTaxAmountDraft#getTotalGross()} property
   * @param taxRate initial value for the {@link ExternalTaxAmountDraft#getTaxRate()} property
   * @return new object initialized with the given values
   */
  public static ExternalTaxAmountDraftBuilder of(final MonetaryAmount totalGross,
      final ExternalTaxRateDraft taxRate) {
    return new ExternalTaxAmountDraftBuilder(taxRate, totalGross);
  }

  /**
   * 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 ExternalTaxAmountDraftBuilder of(final ExternalTaxAmountDraft template) {
    return new ExternalTaxAmountDraftBuilder(template.getTaxRate(), template.getTotalGross());
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy