com.commercetools.history.models.common.ShippingRateImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commercetools-sdk-java-history Show documentation
Show all versions of commercetools-sdk-java-history Show documentation
The e-commerce SDK from commercetools Composable Commerce for Java
package com.commercetools.history.models.common;
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;
/**
* ShippingRate
*/
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
public class ShippingRateImpl implements ShippingRate, ModelBase {
private com.commercetools.history.models.common.Money price;
private com.commercetools.history.models.common.Money freeAbove;
private Boolean isMatching;
private java.util.List tiers;
/**
* create instance with all properties
*/
@JsonCreator
ShippingRateImpl(@JsonProperty("price") final com.commercetools.history.models.common.Money price,
@JsonProperty("freeAbove") final com.commercetools.history.models.common.Money freeAbove,
@JsonProperty("isMatching") final Boolean isMatching,
@JsonProperty("tiers") final java.util.List tiers) {
this.price = price;
this.freeAbove = freeAbove;
this.isMatching = isMatching;
this.tiers = tiers;
}
/**
* create empty instance
*/
public ShippingRateImpl() {
}
/**
*
*/
public com.commercetools.history.models.common.Money getPrice() {
return this.price;
}
/**
*
*/
public com.commercetools.history.models.common.Money getFreeAbove() {
return this.freeAbove;
}
/**
* Only appears in response to requests for ShippingMethods by Cart or location to mark this shipping rate as one that matches the Cart or location.
*/
public Boolean getIsMatching() {
return this.isMatching;
}
/**
*
*/
public java.util.List getTiers() {
return this.tiers;
}
public void setPrice(final com.commercetools.history.models.common.Money price) {
this.price = price;
}
public void setFreeAbove(final com.commercetools.history.models.common.Money freeAbove) {
this.freeAbove = freeAbove;
}
public void setIsMatching(final Boolean isMatching) {
this.isMatching = isMatching;
}
public void setTiers(final com.commercetools.history.models.common.ShippingRatePriceTier... tiers) {
this.tiers = new ArrayList<>(Arrays.asList(tiers));
}
public void setTiers(final java.util.List tiers) {
this.tiers = tiers;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
ShippingRateImpl that = (ShippingRateImpl) o;
return new EqualsBuilder().append(price, that.price)
.append(freeAbove, that.freeAbove)
.append(isMatching, that.isMatching)
.append(tiers, that.tiers)
.append(price, that.price)
.append(freeAbove, that.freeAbove)
.append(isMatching, that.isMatching)
.append(tiers, that.tiers)
.isEquals();
}
@Override
public int hashCode() {
return new HashCodeBuilder(17, 37).append(price)
.append(freeAbove)
.append(isMatching)
.append(tiers)
.toHashCode();
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("price", price)
.append("freeAbove", freeAbove)
.append("isMatching", isMatching)
.append("tiers", tiers)
.build();
}
}