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

io.sphere.sdk.carts.CustomLineItemDraft Maven / Gradle / Ivy

There is a newer version: 1.0.0-M12
Show newest version
package io.sphere.sdk.carts;

import io.sphere.sdk.models.LocalizedStrings;
import io.sphere.sdk.models.Reference;
import io.sphere.sdk.models.Referenceable;
import io.sphere.sdk.taxcategories.TaxCategory;

import javax.money.MonetaryAmount;

public class CustomLineItemDraft {
    private final LocalizedStrings name;
    private final MonetaryAmount money;
    private final String slug;
    private final Reference taxCategory;
    private final long quantity;

    private CustomLineItemDraft(final LocalizedStrings name, final String slug, final MonetaryAmount money, final Referenceable taxCategory, final long quantity) {
        this.name = name;
        this.money = money;
        this.slug = slug;
        this.taxCategory = taxCategory.toReference();
        this.quantity = quantity;
    }

    public static CustomLineItemDraft of(final LocalizedStrings name, final String slug, final MonetaryAmount money, final Referenceable taxCategory, final long quantity) {
        return new CustomLineItemDraft(name, slug, money, taxCategory, quantity);
    }

    public LocalizedStrings getName() {
        return name;
    }

    public MonetaryAmount getMoney() {
        return money;
    }

    public String getSlug() {
        return slug;
    }

    public Reference getTaxCategory() {
        return taxCategory;
    }

    public long getQuantity() {
        return quantity;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy