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

io.sphere.sdk.orders.ProductVariantImportDraftImpl Maven / Gradle / Ivy

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

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.sphere.sdk.products.attributes.AttributeImportDraft;
import io.sphere.sdk.models.Base;
import io.sphere.sdk.products.Image;
import io.sphere.sdk.products.Price;

import javax.annotation.Nullable;
import java.util.List;

final class ProductVariantImportDraftImpl extends Base implements ProductVariantImportDraft {
    @Nullable
    private final Integer id;
    @Nullable
    private final String sku;
    @Nullable
    private final String productId;
    @Nullable
    private final List prices;
    @Nullable
    private final List attributes;
    @Nullable
    private final List images;

    ProductVariantImportDraftImpl(final Integer id, final String sku, final List prices, final List images, final List attributes, final String productId) {
        this.attributes = attributes;
        this.id = id;
        this.sku = sku;
        this.prices = prices;
        this.images = images;
        this.productId = productId;
    }

    @Nullable
    @Override
    public List getAttributes() {
        return attributes;
    }

    @Nullable
    @Override
    public Integer getId() {
        return id;
    }

    @Nullable
    @Override
    public List getImages() {
        return images;
    }

    @Nullable
    @Override
    public List getPrices() {
        return prices;
    }

    @Nullable
    @Override
    public String getSku() {
        return sku;
    }

    /**
     * Hack to initialize {@link LineItemImportDraft} correctly with an SKU or product ID/variant ID pair.
     * @return
     */
    @JsonIgnore
    @Override
    @Nullable
    public String getProductId() {
        return productId;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy