
io.sphere.client.shop.model.ShippingInfo Maven / Gradle / Ivy
package io.sphere.client.shop.model;
import javax.annotation.Nonnull;
import io.sphere.client.model.EmptyReference;
import io.sphere.client.model.Money;
import io.sphere.client.model.Reference;
/** Represents full shipping information for a {@link Cart} or {@link Order}. */
public class ShippingInfo {
@Nonnull private String shippingMethodName;
@Nonnull private Money price;
@Nonnull private ShippingRate shippingRate;
@Nonnull private TaxRate taxRate;
@Nonnull private final Reference taxCategory = EmptyReference.create("taxCategory");
private String trackingData;
//TODO why possibly not set...
private Reference shippingMethod = EmptyReference.create("shippingMethod");
/** The name of the shipping method. */
@Nonnull public String getShippingMethodName() { return shippingMethodName; }
/** The cost of the shipping. */
@Nonnull public Money getPrice() { return price; }
/** The shipping rate that was used to determine the cost of the shipping. */
@Nonnull public ShippingRate getShippingRate() { return shippingRate; }
/** Tracking data is usually some info about the delivery (like a DHL tracking number) which is useful to keep an
* eye on your delivery, view its status etc. */
public String getTrackingData() { return trackingData; }
/** A reference to the shipping method. Null if custom shipping method was used. */
public Reference getShippingMethod() { return shippingMethod; }
/** The tax rate of the shipping method. */
@Nonnull public TaxRate getTaxRate() { return taxRate; }
/** A reference to the tax category of the shipping method. */
@Nonnull public Reference getTaxCategory() { return taxCategory; }
@Override
public String toString() {
return "ShippingInfo{" +
"shippingMethodName='" + shippingMethodName + '\'' +
", price=" + price +
", shippingRate=" + shippingRate +
", taxRate=" + taxRate +
", taxCategory=" + taxCategory +
", trackingData='" + trackingData + '\'' +
", shippingMethod=" + shippingMethod +
'}';
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy