All Downloads are FREE. Search and download functionalities are using the official Maven repository.

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 javax.annotation.Nullable;
import java.util.List;

public class ShippingMethodDraft {
    private final String name;
    @Nullable
    private final String description;
    private final Reference taxCategory;
    private final List zoneRates;
    private final Boolean isDefault;

    private ShippingMethodDraft(final String name, final String 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, @Nullable final String description, final Referenceable taxCategory, final List zoneRates) {
        return of(name, description, taxCategory, zoneRates, false);
    }

    public static ShippingMethodDraft of(final String name, @Nullable final String description, final Referenceable taxCategory, final List zoneRates, final boolean isDefault) {
        return new ShippingMethodDraft(name, description, taxCategory.toReference(), zoneRates, isDefault);
    }

    public String getName() {
        return name;
    }

    @Nullable
    public String getDescription() {
        return description;
    }

    public Reference getTaxCategory() {
        return taxCategory;
    }

    public List getZoneRates() {
        return zoneRates;
    }

    public Boolean isDefault() {
        return isDefault;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy