io.sphere.sdk.products.ProductDraftImpl Maven / Gradle / Ivy
package io.sphere.sdk.products;
import java.util.Optional;
import io.sphere.sdk.categories.Category;
import io.sphere.sdk.models.Base;
import io.sphere.sdk.models.LocalizedStrings;
import io.sphere.sdk.models.MetaAttributes;
import io.sphere.sdk.models.Reference;
import io.sphere.sdk.producttypes.ProductType;
import java.util.List;
class ProductDraftImpl extends Base implements ProductDraft {
private final Reference productType;
private final LocalizedStrings name;
private final LocalizedStrings slug;
private final Optional description;
private final List> categories;
private final Optional metaTitle;
private final Optional metaDescription;
private final Optional metaKeywords;
private final ProductVariantDraft masterVariant;
private final List variants;
public ProductDraftImpl(final Reference productType, final LocalizedStrings name, final LocalizedStrings slug,
final Optional description, final List> categories,
final MetaAttributes metaAttributes, final ProductVariantDraft masterVariant,
final List variants) {
this.name = name;
this.productType = productType;
this.slug = slug;
this.description = description;
this.categories = categories;
this.metaTitle = metaAttributes.getMetaTitle();
this.metaDescription = metaAttributes.getMetaTitle();
this.metaKeywords = metaAttributes.getMetaKeywords();
this.masterVariant = masterVariant;
this.variants = variants;
}
@Override
public Reference getProductType() {
return productType;
}
@Override
public LocalizedStrings getName() {
return name;
}
@Override
public LocalizedStrings getSlug() {
return slug;
}
@Override
public Optional getDescription() {
return description;
}
@Override
public List> getCategories() {
return categories;
}
@Override
public Optional getMetaTitle() {
return metaTitle;
}
@Override
public Optional getMetaDescription() {
return metaDescription;
}
@Override
public Optional getMetaKeywords() {
return metaKeywords;
}
@Override
public ProductVariantDraft getMasterVariant() {
return masterVariant;
}
@Override
public List getVariants() {
return variants;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy