io.sphere.sdk.products.NewProductImpl 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.LocalizedString;
import io.sphere.sdk.models.Reference;
import io.sphere.sdk.producttypes.ProductType;
import java.util.List;
class NewProductImpl extends Base implements NewProduct {
private final Reference productType;
private final LocalizedString name;
private final LocalizedString slug;
private final Optional description;
private final List> categories;
private final Optional metaTitle;
private final Optional metaDescription;
private final Optional metaKeywords;
private final Optional masterVariant;
private final List variants;
public NewProductImpl(final Reference productType, final LocalizedString name, final LocalizedString slug,
final Optional description, final List> categories,
final MetaAttributes metaAttributes, final Optional 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 LocalizedString getName() {
return name;
}
@Override
public LocalizedString 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 Optional getMasterVariant() {
return masterVariant;
}
@Override
public List getVariants() {
return variants;
}
}