io.sphere.sdk.products.ProductProjectionImpl Maven / Gradle / Ivy
The newest version!
package io.sphere.sdk.products;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.sphere.sdk.categories.Category;
import io.sphere.sdk.models.DefaultModelViewImpl;
import io.sphere.sdk.models.LocalizedStrings;
import io.sphere.sdk.models.Reference;
import io.sphere.sdk.producttypes.ProductType;
import io.sphere.sdk.taxcategories.TaxCategory;
import java.time.Instant;
import java.util.List;
import java.util.Optional;
class ProductProjectionImpl extends DefaultModelViewImpl implements ProductProjection {
private final Reference productType;
private final Optional> taxCategory;
@JsonProperty("published")
private final boolean isPublished;
@JsonProperty("hasStagedChanges")
private final boolean hasStagedChanges;
private final LocalizedStrings name;
private final List> categories;
private final Optional description;
private final LocalizedStrings slug;
private final Optional metaTitle;
private final Optional metaDescription;
private final Optional metaKeywords;
private final ProductVariant masterVariant;
private final List variants;
@JsonCreator
ProductProjectionImpl(final String id, final long version, final Instant createdAt, final Instant lastModifiedAt,
final Reference productType, final Optional> taxCategory,
final boolean hasStagedChanges, final LocalizedStrings name,
final List> categories, final Optional description,
final LocalizedStrings slug, final Optional metaTitle,
final Optional metaDescription, final Optional metaKeywords,
final ProductVariant masterVariant, final List variants, final boolean isPublished) {
super(id, version, createdAt, lastModifiedAt);
this.productType = productType;
this.taxCategory = taxCategory;
this.hasStagedChanges = hasStagedChanges;
this.name = name;
this.categories = categories;
this.description = description;
this.slug = slug;
this.metaTitle = metaTitle;
this.metaDescription = metaDescription;
this.metaKeywords = metaKeywords;
this.masterVariant = masterVariant;
this.variants = variants;
this.isPublished = isPublished;
}
public boolean hasStagedChanges() {
return hasStagedChanges;
}
@Override
public LocalizedStrings getName() {
return name;
}
@Override
public List> getCategories() {
return categories;
}
@Override
public Optional getDescription() {
return description;
}
@Override
public LocalizedStrings getSlug() {
return slug;
}
@Override
public Optional getMetaTitle() {
return metaTitle;
}
@Override
public Optional getMetaDescription() {
return metaDescription;
}
@Override
public Optional getMetaKeywords() {
return metaKeywords;
}
@Override
public ProductVariant getMasterVariant() {
return masterVariant;
}
@Override
public List getVariants() {
return variants;
}
@Override
public Reference getProductType() {
return productType;
}
@Override
public Optional> getTaxCategory() {
return taxCategory;
}
@Override
public boolean isPublished() {
return isPublished;
}
}