io.sphere.sdk.products.ProductDataBuilder Maven / Gradle / Ivy
package io.sphere.sdk.products;
import io.sphere.sdk.models.Builder;
import io.sphere.sdk.models.LocalizedStrings;
import java.util.Collections;
import java.util.List;
public class ProductDataBuilder extends ProductDataProductDraftBuilderBase implements Builder {
private final ProductVariant masterVariant;
private List variants = Collections.emptyList();
private ProductDataBuilder(LocalizedStrings name, LocalizedStrings slug, ProductVariant masterVariant) {
super(name, slug);
this.masterVariant = masterVariant;
}
public static ProductDataBuilder of(LocalizedStrings name, LocalizedStrings slug, ProductVariant masterVariant) {
return new ProductDataBuilder(name, slug, masterVariant);
}
@Override
protected ProductDataBuilder getThis() {
return this;
}
@Override
public ProductData build() {
return new ProductDataImpl(getName(), getCategories(), getDescription(), getSlug(), getMetaTitle(), getMetaDescription(), getMetaKeywords(), masterVariant, variants, getSearchKeywords());
}
public ProductDataBuilder variants(final List variants) {
this.variants = variants;
return getThis();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy