io.sphere.sdk.products.ProductDataProductDraftBuilderBase Maven / Gradle / Ivy
package io.sphere.sdk.products;
import io.sphere.sdk.categories.Category;
import io.sphere.sdk.models.*;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
abstract class ProductDataProductDraftBuilderBase> extends Base implements WithLocalizedSlug, MetaAttributes {
private final LocalizedStrings name;
private final LocalizedStrings slug;
private Optional description = Optional.empty();
private Optional metaTitle = Optional.empty();
private Optional metaDescription = Optional.empty();
private Optional metaKeywords = Optional.empty();
private List> categories = Collections.emptyList();
protected ProductDataProductDraftBuilderBase(final LocalizedStrings name, final LocalizedStrings slug) {
this.name = name;
this.slug = slug;
}
public T description(final Optional description) {
this.description = description;
return getThis();
}
public T description(final LocalizedStrings description) {
return description(Optional.of(description));
}
public T metaTitle(final Optional metaTitle) {
this.metaTitle = metaTitle;
return getThis();
}
public T metaTitle(final LocalizedStrings metaTitle) {
return metaTitle(Optional.of(metaTitle));
}
public T metaDescription(final Optional metaDescription) {
this.metaDescription = metaDescription;
return getThis();
}
public T metaDescription(final LocalizedStrings metaDescription) {
return metaDescription(Optional.of(metaDescription));
}
public T metaKeywords(final Optional metaKeywords) {
this.metaKeywords = metaKeywords;
return getThis();
}
public T metaKeywords(final LocalizedStrings metaKeywords) {
return metaKeywords(Optional.of(metaKeywords));
}
public T categories(final List> categories) {
this.categories = categories;
return getThis();
}
public LocalizedStrings getName() {
return name;
}
public LocalizedStrings getSlug() {
return slug;
}
public Optional getDescription() {
return description;
}
public Optional getMetaTitle() {
return metaTitle;
}
public Optional getMetaDescription() {
return metaDescription;
}
public Optional getMetaKeywords() {
return metaKeywords;
}
public List> getCategories() {
return categories;
}
protected abstract T getThis();
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy