io.sphere.sdk.shippingmethods.ZoneRate Maven / Gradle / Ivy
package io.sphere.sdk.shippingmethods;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.sphere.sdk.models.Base;
import io.sphere.sdk.models.Reference;
import io.sphere.sdk.models.Referenceable;
import io.sphere.sdk.zones.Zone;
import java.util.List;
/**
* Defines shipping rates (prices) for a specific zone.
*
* @see ShippingMethod#getZoneRates()
* @see ShippingMethodDraft#getZoneRates()
*/
public final class ZoneRate extends Base {
private final Reference zone;
private final List shippingRates;
@JsonCreator
private ZoneRate(final Reference zone, final List shippingRates) {
this.zone = zone;
this.shippingRates = shippingRates;
}
/**
* Creates a new {@link ZoneRate}.
*
* @param zone zone for the rates to apply
* @param shippingRates costs for different currencies
* @return zone rate
*/
@JsonIgnore
public static ZoneRate of(final Referenceable zone, final List shippingRates) {
return new ZoneRate(zone.toReference(), shippingRates);
}
public Reference getZone() {
return zone;
}
public List getShippingRates() {
return shippingRates;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy