io.sphere.sdk.productdiscounts.ProductDiscountImpl Maven / Gradle / Ivy
package io.sphere.sdk.productdiscounts;
import io.sphere.sdk.models.DefaultModelImpl;
import io.sphere.sdk.models.LocalizedString;
import io.sphere.sdk.models.Reference;
import java.time.Instant;
import java.util.List;
import java.util.Optional;
class ProductDiscountImpl extends DefaultModelImpl implements ProductDiscount {
private final LocalizedString name;
private final Optional description;
private final ProductDiscountValue value;
private final String predicate;
private final String sortOrder;
private final boolean isActive;
private final List> references;
ProductDiscountImpl(final String id, final long version, final Instant createdAt, final Instant lastModifiedAt,
final LocalizedString name, final Optional description,
final ProductDiscountValue value, final String predicate, final String sortOrder,
final boolean isActive, final List> references) {
super(id, version, createdAt, lastModifiedAt);
this.name = name;
this.description = description;
this.value = value;
this.predicate = predicate;
this.sortOrder = sortOrder;
this.isActive = isActive;
this.references = references;
}
public LocalizedString getName() {
return name;
}
public Optional getDescription() {
return description;
}
public ProductDiscountValue getValue() {
return value;
}
public String getPredicate() {
return predicate;
}
public String getSortOrder() {
return sortOrder;
}
public boolean isActive() {
return isActive;
}
public List> getReferences() {
return references;
}
@Override
public Reference toReference() {
return Reference.of(ProductDiscount.typeId(), this);
}
}