All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.sphere.sdk.productdiscounts.ProductDiscountImpl Maven / Gradle / Ivy

There is a newer version: 1.0.0-M26
Show newest version
package io.sphere.sdk.productdiscounts;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.databind.JsonNode;
import io.sphere.sdk.models.LocalizedString;
import io.sphere.sdk.models.ResourceImpl;
import io.sphere.sdk.models.Reference;

import javax.annotation.Nullable;
import java.time.ZonedDateTime;
import java.util.List;

class ProductDiscountImpl extends ResourceImpl implements ProductDiscount {
    private final LocalizedString name;
    private final LocalizedString description;
    private final ProductDiscountValue value;
    private final String predicate;
    private final String sortOrder;
    private final Boolean isActive;
    private final List> references;

    @JsonCreator
    ProductDiscountImpl(final String id, final Long version, final ZonedDateTime createdAt, final ZonedDateTime lastModifiedAt,
                        final LocalizedString name, final LocalizedString 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;
    }

    @Nullable
    public LocalizedString 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.referenceTypeId(), this);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy