io.sphere.sdk.shippingmethods.ShippingMethodDraft Maven / Gradle / Ivy
package io.sphere.sdk.shippingmethods;
import io.sphere.sdk.models.Reference;
import io.sphere.sdk.models.Referenceable;
import io.sphere.sdk.taxcategories.TaxCategory;
import java.util.List;
import java.util.Optional;
public class ShippingMethodDraft {
private final String name;
private final Optional description;
private final Reference taxCategory;
private final List zoneRates;
private final boolean isDefault;
private ShippingMethodDraft(final String name, final Optional description, final Reference taxCategory, final List zoneRates, final boolean isDefault) {
this.name = name;
this.description = description;
this.taxCategory = taxCategory;
this.zoneRates = zoneRates;
this.isDefault = isDefault;
}
public static ShippingMethodDraft of(final String name, final String description, final Referenceable taxCategory, final List zoneRates) {
return of(name, Optional.of(description), taxCategory, zoneRates, false);
}
public static ShippingMethodDraft of(final String name, final Optional description, final Referenceable taxCategory, final List zoneRates, final boolean isDefault) {
return new ShippingMethodDraft(name, description, taxCategory.toReference(), zoneRates, isDefault);
}
public String getName() {
return name;
}
public Optional getDescription() {
return description;
}
public Reference getTaxCategory() {
return taxCategory;
}
public List getZoneRates() {
return zoneRates;
}
public boolean isDefault() {
return isDefault;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy