io.sphere.sdk.products.ProductDraftImpl Maven / Gradle / Ivy
package io.sphere.sdk.products;
import io.sphere.sdk.categories.Category;
import io.sphere.sdk.models.Base;
import io.sphere.sdk.models.LocalizedString;
import io.sphere.sdk.models.MetaAttributes;
import io.sphere.sdk.models.Reference;
import io.sphere.sdk.producttypes.ProductType;
import io.sphere.sdk.search.SearchKeywords;
import io.sphere.sdk.states.State;
import io.sphere.sdk.taxcategories.TaxCategory;
import javax.annotation.Nullable;
import java.util.List;
import java.util.Set;
class ProductDraftImpl extends Base implements ProductDraft {
private final Reference productType;
private final LocalizedString name;
private final LocalizedString slug;
@Nullable
private final LocalizedString description;
private final Set> categories;
@Nullable
private final LocalizedString metaTitle;
@Nullable
private final LocalizedString metaDescription;
@Nullable
private final LocalizedString metaKeywords;
private final ProductVariantDraft masterVariant;
private final List variants;
private final Reference taxCategory;
private final SearchKeywords searchKeywords;
@Nullable
private final Reference state;
@Nullable
private final CategoryOrderHints categoryOrderHints;
public ProductDraftImpl(final Reference productType, final LocalizedString name, final LocalizedString slug,
final LocalizedString description, final Set> categories,
final MetaAttributes metaAttributes, final ProductVariantDraft masterVariant,
final List variants, final Reference taxCategory,
final SearchKeywords searchKeywords, final Reference state,
final CategoryOrderHints categoryOrderHints) {
this.name = name;
this.productType = productType;
this.slug = slug;
this.description = description;
this.categories = categories;
this.taxCategory = taxCategory;
this.searchKeywords = searchKeywords;
this.state = state;
this.metaTitle = metaAttributes.getMetaTitle();
this.metaDescription = metaAttributes.getMetaTitle();
this.metaKeywords = metaAttributes.getMetaKeywords();
this.masterVariant = masterVariant;
this.variants = variants;
this.categoryOrderHints = categoryOrderHints;
}
@Override
public Reference getProductType() {
return productType;
}
@Override
public LocalizedString getName() {
return name;
}
@Override
public LocalizedString getSlug() {
return slug;
}
@Override
@Nullable
public LocalizedString getDescription() {
return description;
}
@Override
public Set> getCategories() {
return categories;
}
@Nullable
@Override
public LocalizedString getMetaTitle() {
return metaTitle;
}
@Nullable
@Override
public LocalizedString getMetaDescription() {
return metaDescription;
}
@Nullable
@Override
public LocalizedString getMetaKeywords() {
return metaKeywords;
}
@Override
public ProductVariantDraft getMasterVariant() {
return masterVariant;
}
@Override
public List getVariants() {
return variants;
}
@Nullable
@Override
public Reference getTaxCategory() {
return taxCategory;
}
@Override
public SearchKeywords getSearchKeywords() {
return searchKeywords;
}
@Override
@Nullable
public Reference getState() {
return state;
}
@Override
@Nullable
public CategoryOrderHints getCategoryOrderHints() {
return categoryOrderHints;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy