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

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

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

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

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

  private String function;

  PriceFunctionBuilder() {
  }

  PriceFunctionBuilder(final String currencyCode, final String function) {
    this.currencyCode = currencyCode;
    this.function = function;
  }

  /**
   * Sets the {@code currencyCode} property of this builder.
   *
   * @param currencyCode the value for {@link PriceFunction#getCurrencyCode()}
   * @return this builder
   */
  public PriceFunctionBuilder currencyCode(final String currencyCode) {
    this.currencyCode = currencyCode;
    return this;
  }

  /**
   * Sets the {@code function} property of this builder.
   *
   * @param function the value for {@link PriceFunction#getFunction()}
   * @return this builder
   */
  public PriceFunctionBuilder function(final String function) {
    this.function = function;
    return this;
  }

  /**
   * Creates a new instance of {@code PriceFunction} with the values of this builder.
   *
   * @return the instance
   */
  public PriceFunction build() {
    return new PriceFunctionImpl(currencyCode, function);
  }

  /**
   * Creates a new object initialized with the given values.
   *
   * @param currencyCode initial value for the {@link PriceFunction#getCurrencyCode()} property
   * @param function initial value for the {@link PriceFunction#getFunction()} property
   * @return new object initialized with the given values
   */
  public static PriceFunctionBuilder of(final String currencyCode, final String function) {
    return new PriceFunctionBuilder(currencyCode, function);
  }

  /**
   * 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 PriceFunctionBuilder of(final PriceFunction template) {
    return new PriceFunctionBuilder(template.getCurrencyCode(), template.getFunction());
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy