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

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

The 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 int quantity;

    private CustomLineItemDraft(final LocalizedStrings name, final String slug, final MonetaryAmount money, final Referenceable taxCategory, final int 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 int 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 int getQuantity() {
        return quantity;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy