com.commercetools.importapi.models.prices.PriceImportImpl Maven / Gradle / Ivy
Show all versions of commercetools-sdk-java-importapi Show documentation
package com.commercetools.importapi.models.prices;
import java.time.*;
import java.util.*;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.*;
import io.vrap.rmf.base.client.ModelBase;
import io.vrap.rmf.base.client.utils.Generated;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* The data representation for a price to be imported that is persisted as a Price in the Project.
*/
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
public class PriceImportImpl implements PriceImport, ModelBase {
private String key;
private com.commercetools.importapi.models.common.TypedMoney value;
private String country;
private java.time.ZonedDateTime validFrom;
private java.time.ZonedDateTime validUntil;
private com.commercetools.importapi.models.common.CustomerGroupKeyReference customerGroup;
private com.commercetools.importapi.models.common.ChannelKeyReference channel;
private com.commercetools.importapi.models.common.DiscountedPrice discounted;
@Deprecated
private Boolean publish;
private Boolean staged;
private java.util.List tiers;
private com.commercetools.importapi.models.customfields.Custom custom;
private com.commercetools.importapi.models.common.ProductVariantKeyReference productVariant;
private com.commercetools.importapi.models.common.ProductKeyReference product;
/**
* create instance with all properties
*/
@JsonCreator
PriceImportImpl(@JsonProperty("key") final String key,
@JsonProperty("value") final com.commercetools.importapi.models.common.TypedMoney value,
@JsonProperty("country") final String country,
@JsonProperty("validFrom") final java.time.ZonedDateTime validFrom,
@JsonProperty("validUntil") final java.time.ZonedDateTime validUntil,
@JsonProperty("customerGroup") final com.commercetools.importapi.models.common.CustomerGroupKeyReference customerGroup,
@JsonProperty("channel") final com.commercetools.importapi.models.common.ChannelKeyReference channel,
@JsonProperty("discounted") final com.commercetools.importapi.models.common.DiscountedPrice discounted,
@JsonProperty("publish") final Boolean publish, @JsonProperty("staged") final Boolean staged,
@JsonProperty("tiers") final java.util.List tiers,
@JsonProperty("custom") final com.commercetools.importapi.models.customfields.Custom custom,
@JsonProperty("productVariant") final com.commercetools.importapi.models.common.ProductVariantKeyReference productVariant,
@JsonProperty("product") final com.commercetools.importapi.models.common.ProductKeyReference product) {
this.key = key;
this.value = value;
this.country = country;
this.validFrom = validFrom;
this.validUntil = validUntil;
this.customerGroup = customerGroup;
this.channel = channel;
this.discounted = discounted;
this.publish = publish;
this.staged = staged;
this.tiers = tiers;
this.custom = custom;
this.productVariant = productVariant;
this.product = product;
}
/**
* create empty instance
*/
public PriceImportImpl() {
}
/**
* User-defined unique identifier for the Embedded Price. If a Price with this key
exists on the specified productVariant
, it will be updated with the imported data.
*/
public String getKey() {
return this.key;
}
/**
* Maps to Price.value
.
*/
public com.commercetools.importapi.models.common.TypedMoney getValue() {
return this.value;
}
/**
* Maps to Price.county
.
*/
public String getCountry() {
return this.country;
}
/**
* Maps to Price.validFrom
.
*/
public java.time.ZonedDateTime getValidFrom() {
return this.validFrom;
}
/**
* Maps to Price.validUntil
.
*/
public java.time.ZonedDateTime getValidUntil() {
return this.validUntil;
}
/**
* The Reference to the CustomerGroup with which the Price is associated. If referenced CustomerGroup does not exist, the state
of the ImportOperation will be set to unresolved
until the necessary CustomerGroup is created.
*/
public com.commercetools.importapi.models.common.CustomerGroupKeyReference getCustomerGroup() {
return this.customerGroup;
}
/**
* The Reference to the Channel with which the Price is associated. If referenced Channel does not exist, the state
of the ImportOperation will be set to unresolved
until the necessary Channel is created.
*/
public com.commercetools.importapi.models.common.ChannelKeyReference getChannel() {
return this.channel;
}
/**
* Sets a discounted price from an external service.
*/
public com.commercetools.importapi.models.common.DiscountedPrice getDiscounted() {
return this.discounted;
}
/**
* Only the Embedded Price updates will be published to staged
and current
projection.
*/
@Deprecated
public Boolean getPublish() {
return this.publish;
}
/**
*
* - Set to
false
to update both the current and staged projections of the Product with the new Price data.
* - Leave empty or set to
true
to only update the staged projection.
*
*/
public Boolean getStaged() {
return this.staged;
}
/**
* The tiered prices for this price.
*/
public java.util.List getTiers() {
return this.tiers;
}
/**
* The custom fields for this price.
*/
public com.commercetools.importapi.models.customfields.Custom getCustom() {
return this.custom;
}
/**
* The ProductVariant in which this Embedded Price is contained. The Reference to the ProductVariant with which the Price is associated. If referenced ProductVariant does not exist, the state
of the ImportOperation will be set to unresolved
until the necessary ProductVariant is created.
*/
public com.commercetools.importapi.models.common.ProductVariantKeyReference getProductVariant() {
return this.productVariant;
}
/**
* The Product in which the Product Variant containing this Embedded Price is contained. Maps to ProductVariant.product
. The Reference to the Product with which the Price is associated. If referenced Product does not exist, the state
of the ImportOperation will be set to unresolved
until the necessary Product is created.
*/
public com.commercetools.importapi.models.common.ProductKeyReference getProduct() {
return this.product;
}
public void setKey(final String key) {
this.key = key;
}
public void setValue(final com.commercetools.importapi.models.common.TypedMoney value) {
this.value = value;
}
public void setCountry(final String country) {
this.country = country;
}
public void setValidFrom(final java.time.ZonedDateTime validFrom) {
this.validFrom = validFrom;
}
public void setValidUntil(final java.time.ZonedDateTime validUntil) {
this.validUntil = validUntil;
}
public void setCustomerGroup(
final com.commercetools.importapi.models.common.CustomerGroupKeyReference customerGroup) {
this.customerGroup = customerGroup;
}
public void setChannel(final com.commercetools.importapi.models.common.ChannelKeyReference channel) {
this.channel = channel;
}
public void setDiscounted(final com.commercetools.importapi.models.common.DiscountedPrice discounted) {
this.discounted = discounted;
}
@Deprecated
public void setPublish(final Boolean publish) {
this.publish = publish;
}
public void setStaged(final Boolean staged) {
this.staged = staged;
}
public void setTiers(final com.commercetools.importapi.models.common.PriceTier... tiers) {
this.tiers = new ArrayList<>(Arrays.asList(tiers));
}
public void setTiers(final java.util.List tiers) {
this.tiers = tiers;
}
public void setCustom(final com.commercetools.importapi.models.customfields.Custom custom) {
this.custom = custom;
}
public void setProductVariant(
final com.commercetools.importapi.models.common.ProductVariantKeyReference productVariant) {
this.productVariant = productVariant;
}
public void setProduct(final com.commercetools.importapi.models.common.ProductKeyReference product) {
this.product = product;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
PriceImportImpl that = (PriceImportImpl) o;
return new EqualsBuilder().append(key, that.key)
.append(value, that.value)
.append(country, that.country)
.append(validFrom, that.validFrom)
.append(validUntil, that.validUntil)
.append(customerGroup, that.customerGroup)
.append(channel, that.channel)
.append(discounted, that.discounted)
.append(publish, that.publish)
.append(staged, that.staged)
.append(tiers, that.tiers)
.append(custom, that.custom)
.append(productVariant, that.productVariant)
.append(product, that.product)
.append(key, that.key)
.append(value, that.value)
.append(country, that.country)
.append(validFrom, that.validFrom)
.append(validUntil, that.validUntil)
.append(customerGroup, that.customerGroup)
.append(channel, that.channel)
.append(discounted, that.discounted)
.append(publish, that.publish)
.append(staged, that.staged)
.append(tiers, that.tiers)
.append(custom, that.custom)
.append(productVariant, that.productVariant)
.append(product, that.product)
.isEquals();
}
@Override
public int hashCode() {
return new HashCodeBuilder(17, 37).append(key)
.append(value)
.append(country)
.append(validFrom)
.append(validUntil)
.append(customerGroup)
.append(channel)
.append(discounted)
.append(publish)
.append(staged)
.append(tiers)
.append(custom)
.append(productVariant)
.append(product)
.toHashCode();
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("key", key)
.append("value", value)
.append("country", country)
.append("validFrom", validFrom)
.append("validUntil", validUntil)
.append("customerGroup", customerGroup)
.append("channel", channel)
.append("discounted", discounted)
.append("publish", publish)
.append("staged", staged)
.append("tiers", tiers)
.append("custom", custom)
.append("productVariant", productVariant)
.append("product", product)
.build();
}
}