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

io.sphere.sdk.products.PriceDraft Maven / Gradle / Ivy

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

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.neovisionaries.i18n.CountryCode;
import io.sphere.sdk.channels.Channel;
import io.sphere.sdk.customergroups.CustomerGroup;
import io.sphere.sdk.models.Reference;
import io.sphere.sdk.types.CustomDraft;
import io.sphere.sdk.types.CustomFieldsDraft;
import io.sphere.sdk.utils.MoneyImpl;

import javax.annotation.Nullable;
import javax.money.CurrencyUnit;
import javax.money.MonetaryAmount;
import java.math.BigDecimal;
import java.time.ZonedDateTime;

public interface PriceDraft extends CustomDraft {
    MonetaryAmount getValue();
    @Nullable
    CountryCode getCountry();
    @Nullable
    Reference getCustomerGroup();

    @Nullable
    Reference getChannel();

    @Nullable
    ZonedDateTime getValidFrom();
    @Nullable
    ZonedDateTime getValidUntil();

    CustomFieldsDraft getCustom();

    @JsonIgnore
    static PriceDraftDsl of(final MonetaryAmount money) {
        return PriceDraftBuilder.of(money).build();
    }

    @JsonIgnore
    static PriceDraftDsl of(final BigDecimal amount, final CurrencyUnit currencyUnit) {
        return of(MoneyImpl.of(amount, currencyUnit));
    }

    static PriceDraftDsl of(final Price template) {
        return PriceDraftDsl.of(template);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy