io.sphere.sdk.carts.CartDraftDslBase Maven / Gradle / Ivy
package io.sphere.sdk.carts;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.neovisionaries.i18n.CountryCode;
import io.sphere.sdk.customergroups.CustomerGroup;
import io.sphere.sdk.models.Address;
import io.sphere.sdk.models.Base;
import io.sphere.sdk.models.ResourceIdentifier;
import io.sphere.sdk.shippingmethods.ShippingMethod;
import io.sphere.sdk.stores.Store;
import io.sphere.sdk.taxcategories.ExternalTaxRateDraft;
import io.sphere.sdk.types.CustomFieldsDraft;
import java.lang.Integer;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.List;
import java.util.Locale;
import javax.annotation.Generated;
import javax.annotation.Nullable;
import javax.money.CurrencyUnit;
/**
* Abstract base dsl class for {@link CartDraft} which needs to be extended to add additional methods.
* Subclasses have to provide the same non-default constructor as this class.
*/
@Generated(
value = "io.sphere.sdk.annotations.processors.generators.ResourceDraftValueGenerator",
comments = "Generated from: io.sphere.sdk.carts.CartDraft"
)
abstract class CartDraftDslBase extends Base implements CartDraft {
@Nullable
private String anonymousId;
@Nullable
private Address billingAddress;
@Nullable
private CountryCode country;
private CurrencyUnit currency;
@Nullable
private CustomFieldsDraft custom;
@Nullable
private List customLineItems;
@Nullable
private String customerEmail;
@Nullable
private ResourceIdentifier customerGroup;
@Nullable
private String customerId;
@Nullable
private Integer deleteDaysAfterLastModification;
@Nullable
private List discountCodes;
@Nullable
private ExternalTaxRateDraft externalTaxRateForShippingMethod;
@Nullable
private InventoryMode inventoryMode;
@Nullable
private List itemShippingAddresses;
@Nullable
private List lineItems;
@Nullable
private Locale locale;
@Nullable
private CartOrigin origin;
@Nullable
private Address shippingAddress;
@Nullable
private ResourceIdentifier shippingMethod;
@Nullable
private ShippingRateInputDraft shippingRateInput;
@Nullable
private ResourceIdentifier store;
@Nullable
private TaxCalculationMode taxCalculationMode;
@Nullable
private TaxMode taxMode;
@Nullable
private RoundingMode taxRoundingMode;
@JsonCreator
CartDraftDslBase(@Nullable final String anonymousId, @Nullable final Address billingAddress,
@Nullable final CountryCode country, final CurrencyUnit currency,
@Nullable final CustomFieldsDraft custom,
@Nullable final List customLineItems,
@Nullable final String customerEmail,
@Nullable final ResourceIdentifier customerGroup,
@Nullable final String customerId, @Nullable final Integer deleteDaysAfterLastModification,
@Nullable final List discountCodes,
@Nullable final ExternalTaxRateDraft externalTaxRateForShippingMethod,
@Nullable final InventoryMode inventoryMode,
@Nullable final List itemShippingAddresses,
@Nullable final List lineItems, @Nullable final Locale locale,
@Nullable final CartOrigin origin, @Nullable final Address shippingAddress,
@Nullable final ResourceIdentifier shippingMethod,
@Nullable final ShippingRateInputDraft shippingRateInput,
@Nullable final ResourceIdentifier store,
@Nullable final TaxCalculationMode taxCalculationMode, @Nullable final TaxMode taxMode,
@Nullable final RoundingMode taxRoundingMode) {
this.anonymousId = anonymousId;
this.billingAddress = billingAddress;
this.country = country;
this.currency = currency;
this.custom = custom;
this.customLineItems = customLineItems;
this.customerEmail = customerEmail;
this.customerGroup = customerGroup;
this.customerId = customerId;
this.deleteDaysAfterLastModification = deleteDaysAfterLastModification;
this.discountCodes = discountCodes;
this.externalTaxRateForShippingMethod = externalTaxRateForShippingMethod;
this.inventoryMode = inventoryMode;
this.itemShippingAddresses = itemShippingAddresses;
this.lineItems = lineItems;
this.locale = locale;
this.origin = origin;
this.shippingAddress = shippingAddress;
this.shippingMethod = shippingMethod;
this.shippingRateInput = shippingRateInput;
this.store = store;
this.taxCalculationMode = taxCalculationMode;
this.taxMode = taxMode;
this.taxRoundingMode = taxRoundingMode;
}
@Nullable
public String getAnonymousId() {
return anonymousId;
}
@Nullable
public Address getBillingAddress() {
return billingAddress;
}
@Nullable
public CountryCode getCountry() {
return country;
}
public CurrencyUnit getCurrency() {
return currency;
}
@Nullable
public CustomFieldsDraft getCustom() {
return custom;
}
@Nullable
public List getCustomLineItems() {
return customLineItems;
}
@Nullable
public String getCustomerEmail() {
return customerEmail;
}
@Nullable
public ResourceIdentifier getCustomerGroup() {
return customerGroup;
}
@Nullable
public String getCustomerId() {
return customerId;
}
@Nullable
public Integer getDeleteDaysAfterLastModification() {
return deleteDaysAfterLastModification;
}
@Nullable
public List getDiscountCodes() {
return discountCodes;
}
@Nullable
public ExternalTaxRateDraft getExternalTaxRateForShippingMethod() {
return externalTaxRateForShippingMethod;
}
@Nullable
public InventoryMode getInventoryMode() {
return inventoryMode;
}
@Nullable
public List getItemShippingAddresses() {
return itemShippingAddresses;
}
@Nullable
public List getLineItems() {
return lineItems;
}
@Nullable
public Locale getLocale() {
return locale;
}
@Nullable
public CartOrigin getOrigin() {
return origin;
}
@Nullable
public Address getShippingAddress() {
return shippingAddress;
}
@Nullable
public ResourceIdentifier getShippingMethod() {
return shippingMethod;
}
@Nullable
public ShippingRateInputDraft getShippingRateInput() {
return shippingRateInput;
}
@Nullable
public ResourceIdentifier getStore() {
return store;
}
@Nullable
public TaxCalculationMode getTaxCalculationMode() {
return taxCalculationMode;
}
@Nullable
public TaxMode getTaxMode() {
return taxMode;
}
@Nullable
public RoundingMode getTaxRoundingMode() {
return taxRoundingMode;
}
/**
* Creates a new builder with the values of this object.
*
* @return new builder
*/
public CartDraftBuilder newBuilder() {
return new CartDraftBuilder(anonymousId, billingAddress, country, currency, custom, customLineItems, customerEmail, customerGroup, customerId, deleteDaysAfterLastModification, discountCodes, externalTaxRateForShippingMethod, inventoryMode, itemShippingAddresses, lineItems, locale, origin, shippingAddress, shippingMethod, shippingRateInput, store, taxCalculationMode, taxMode, taxRoundingMode);
}
@SuppressWarnings("unchecked")
public T withAnonymousId(@Nullable final String anonymousId) {
return (T) newBuilder().anonymousId(anonymousId).build();
}
@SuppressWarnings("unchecked")
public T withBillingAddress(@Nullable final Address billingAddress) {
return (T) newBuilder().billingAddress(billingAddress).build();
}
@SuppressWarnings("unchecked")
public T withCountry(@Nullable final CountryCode country) {
return (T) newBuilder().country(country).build();
}
@SuppressWarnings("unchecked")
public T withCurrency(final CurrencyUnit currency) {
return (T) newBuilder().currency(currency).build();
}
@SuppressWarnings("unchecked")
public T withCustom(@Nullable final CustomFieldsDraft custom) {
return (T) newBuilder().custom(custom).build();
}
@SuppressWarnings("unchecked")
public T withCustomLineItems(@Nullable final List customLineItems) {
return (T) newBuilder().customLineItems(customLineItems).build();
}
@SuppressWarnings("unchecked")
public T withCustomerEmail(@Nullable final String customerEmail) {
return (T) newBuilder().customerEmail(customerEmail).build();
}
@SuppressWarnings("unchecked")
public T withCustomerGroup(@Nullable final ResourceIdentifier customerGroup) {
return (T) newBuilder().customerGroup(customerGroup).build();
}
@SuppressWarnings("unchecked")
public T withCustomerId(@Nullable final String customerId) {
return (T) newBuilder().customerId(customerId).build();
}
@SuppressWarnings("unchecked")
public T withDeleteDaysAfterLastModification(
@Nullable final Integer deleteDaysAfterLastModification) {
return (T) newBuilder().deleteDaysAfterLastModification(deleteDaysAfterLastModification).build();
}
@SuppressWarnings("unchecked")
public T withDiscountCodes(@Nullable final List discountCodes) {
return (T) newBuilder().discountCodes(discountCodes).build();
}
@SuppressWarnings("unchecked")
public T withExternalTaxRateForShippingMethod(
@Nullable final ExternalTaxRateDraft externalTaxRateForShippingMethod) {
return (T) newBuilder().externalTaxRateForShippingMethod(externalTaxRateForShippingMethod).build();
}
@SuppressWarnings("unchecked")
public T withInventoryMode(@Nullable final InventoryMode inventoryMode) {
return (T) newBuilder().inventoryMode(inventoryMode).build();
}
@SuppressWarnings("unchecked")
public T withItemShippingAddresses(@Nullable final List itemShippingAddresses) {
return (T) newBuilder().itemShippingAddresses(itemShippingAddresses).build();
}
@SuppressWarnings("unchecked")
public T withLineItems(@Nullable final List lineItems) {
return (T) newBuilder().lineItems(lineItems).build();
}
@SuppressWarnings("unchecked")
public T withLocale(@Nullable final Locale locale) {
return (T) newBuilder().locale(locale).build();
}
@SuppressWarnings("unchecked")
public T withOrigin(@Nullable final CartOrigin origin) {
return (T) newBuilder().origin(origin).build();
}
@SuppressWarnings("unchecked")
public T withShippingAddress(@Nullable final Address shippingAddress) {
return (T) newBuilder().shippingAddress(shippingAddress).build();
}
@SuppressWarnings("unchecked")
public T withShippingMethod(@Nullable final ResourceIdentifier shippingMethod) {
return (T) newBuilder().shippingMethod(shippingMethod).build();
}
@SuppressWarnings("unchecked")
public T withShippingRateInput(@Nullable final ShippingRateInputDraft shippingRateInput) {
return (T) newBuilder().shippingRateInput(shippingRateInput).build();
}
@SuppressWarnings("unchecked")
public T withStore(@Nullable final ResourceIdentifier store) {
return (T) newBuilder().store(store).build();
}
@SuppressWarnings("unchecked")
public T withTaxCalculationMode(@Nullable final TaxCalculationMode taxCalculationMode) {
return (T) newBuilder().taxCalculationMode(taxCalculationMode).build();
}
@SuppressWarnings("unchecked")
public T withTaxMode(@Nullable final TaxMode taxMode) {
return (T) newBuilder().taxMode(taxMode).build();
}
@SuppressWarnings("unchecked")
public T withTaxRoundingMode(@Nullable final RoundingMode taxRoundingMode) {
return (T) newBuilder().taxRoundingMode(taxRoundingMode).build();
}
/**
* Creates a new object initialized with the given values.
*
* @param currency initial value for the {@link CartDraft#getCurrency()} property
* @return new object initialized with the given values
*/
public static CartDraftDsl of(final CurrencyUnit currency) {
return new CartDraftDsl(null, null, null, currency, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null);
}
/**
* 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 CartDraftDsl of(final CartDraft template) {
return new CartDraftDsl(template.getAnonymousId(), template.getBillingAddress(), template.getCountry(), template.getCurrency(), template.getCustom(), template.getCustomLineItems(), template.getCustomerEmail(), template.getCustomerGroup(), template.getCustomerId(), template.getDeleteDaysAfterLastModification(), template.getDiscountCodes(), template.getExternalTaxRateForShippingMethod(), template.getInventoryMode(), template.getItemShippingAddresses(), template.getLineItems(), template.getLocale(), template.getOrigin(), template.getShippingAddress(), template.getShippingMethod(), template.getShippingRateInput(), template.getStore(), template.getTaxCalculationMode(), template.getTaxMode(), template.getTaxRoundingMode());
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy