Interface ProductDiscount
- All Superinterfaces:
BaseResource,DomainResource<ProductDiscount>,Identifiable<ProductDiscount>,ProductDiscountMixin,Referencable<ProductDiscount>,ResourceIdentifiable<ProductDiscount>,Versioned<ProductDiscount>,WithKey
Example to create an instance using the builder pattern
ProductDiscount productDiscount = ProductDiscount.builder()
.id("{id}")
.version(0.3)
.createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.name(nameBuilder -> nameBuilder)
.value(valueBuilder -> valueBuilder)
.predicate("{predicate}")
.sortOrder("{sortOrder}")
.isActive(true)
.plusReferences(referencesBuilder -> referencesBuilder)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic ProductDiscountBuilderbuilder()builder factory method for ProductDiscountstatic ProductDiscountBuilderbuilder(ProductDiscount template) create builder for ProductDiscount instancecopyDeep()static ProductDiscountdeepCopy(ProductDiscount template) factory method to create a deep copy of ProductDiscount@NotNull ZonedDateTimeDate and time (UTC) the ProductDiscount was initially created.@Valid CreatedByIDs and references that created the ProductDiscount.@Valid LocalizedStringDescription of the ProductDiscount.@NotNull StringgetId()Unique identifier of the ProductDiscount.@NotNull BooleanIftruethe Product Discount is applied to Products matching thepredicate.getKey()User-defined unique identifier of the ProductDiscount.@NotNull ZonedDateTimeDate and time (UTC) the ProductDiscount was last updated.@Valid LastModifiedByIDs and references that last modified the ProductDiscount.@NotNull @Valid LocalizedStringgetName()Name of the ProductDiscount.@NotNull StringValid ProductDiscount predicate.References of all the resources that are addressed in thepredicate.@NotNull StringUnique decimal value between 0 and 1 (stored as String literal) defining the order of Product Discounts to apply in case more than one is applicable and active.Date and time (UTC) from which the Discount is effective.Date and time (UTC) until which the Discount is effective.@NotNull @Valid ProductDiscountValuegetValue()Type of Discount and its corresponding value.@NotNull LongCurrent version of the ProductDiscount.static ProductDiscountof()factory methodstatic ProductDiscountof(ProductDiscount template) factory method to create a shallow copy ProductDiscountstatic ReferenceTypeIdvoidsetCreatedAt(ZonedDateTime createdAt) Date and time (UTC) the ProductDiscount was initially created.voidsetCreatedBy(CreatedBy createdBy) IDs and references that created the ProductDiscount.voidsetDescription(LocalizedString description) Description of the ProductDiscount.voidUnique identifier of the ProductDiscount.voidsetIsActive(Boolean isActive) Iftruethe Product Discount is applied to Products matching thepredicate.voidUser-defined unique identifier of the ProductDiscount.voidsetLastModifiedAt(ZonedDateTime lastModifiedAt) Date and time (UTC) the ProductDiscount was last updated.voidsetLastModifiedBy(LastModifiedBy lastModifiedBy) IDs and references that last modified the ProductDiscount.voidsetName(LocalizedString name) Name of the ProductDiscount.voidsetPredicate(String predicate) Valid ProductDiscount predicate.voidsetReferences(Reference... references) References of all the resources that are addressed in thepredicate.voidsetReferences(List<Reference> references) References of all the resources that are addressed in thepredicate.voidsetSortOrder(String sortOrder) Unique decimal value between 0 and 1 (stored as String literal) defining the order of Product Discounts to apply in case more than one is applicable and active.voidsetValidFrom(ZonedDateTime validFrom) Date and time (UTC) from which the Discount is effective.voidsetValidUntil(ZonedDateTime validUntil) Date and time (UTC) until which the Discount is effective.voidsetValue(ProductDiscountValue value) Type of Discount and its corresponding value.voidsetVersion(Long version) Current version of the ProductDiscount.static com.fasterxml.jackson.core.type.TypeReference<ProductDiscount>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithProductDiscount(Function<ProductDiscount, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.common.BaseResource
withBaseResourceMethods inherited from interface com.commercetools.api.models.DomainResource
getMethods inherited from interface com.commercetools.api.models.product_discount.ProductDiscountMixin
toReference, toResourceIdentifier
-
Method Details
-
getId
Unique identifier of the ProductDiscount.
- Specified by:
getIdin interfaceBaseResource- Specified by:
getIdin interfaceDomainResource<ProductDiscount>- Specified by:
getIdin interfaceIdentifiable<ProductDiscount>- Specified by:
getIdin interfaceVersioned<ProductDiscount>- Returns:
- id
-
getVersion
Current version of the ProductDiscount.
- Specified by:
getVersionin interfaceBaseResource- Specified by:
getVersionin interfaceDomainResource<ProductDiscount>- Specified by:
getVersionin interfaceVersioned<ProductDiscount>- Returns:
- version
-
getCreatedAt
Date and time (UTC) the ProductDiscount was initially created.
- Specified by:
getCreatedAtin interfaceBaseResource- Returns:
- createdAt
-
getLastModifiedAt
Date and time (UTC) the ProductDiscount was last updated.
- Specified by:
getLastModifiedAtin interfaceBaseResource- Returns:
- lastModifiedAt
-
getLastModifiedBy
IDs and references that last modified the ProductDiscount.
- Returns:
- lastModifiedBy
-
getCreatedBy
IDs and references that created the ProductDiscount.
- Returns:
- createdBy
-
getName
Name of the ProductDiscount.
- Returns:
- name
-
getKey
String getKey()User-defined unique identifier of the ProductDiscount.
-
getDescription
Description of the ProductDiscount.
- Returns:
- description
-
getValue
Type of Discount and its corresponding value.
- Returns:
- value
-
getPredicate
Valid ProductDiscount predicate.
- Returns:
- predicate
-
getSortOrder
Unique decimal value between 0 and 1 (stored as String literal) defining the order of Product Discounts to apply in case more than one is applicable and active. A Product Discount with a higher value is prioritized.
- Returns:
- sortOrder
-
getIsActive
If
truethe Product Discount is applied to Products matching thepredicate.- Returns:
- isActive
-
getReferences
References of all the resources that are addressed in the
predicate.- Returns:
- references
-
getValidFrom
ZonedDateTime getValidFrom()Date and time (UTC) from which the Discount is effective. Take Eventual Consistency into account for calculated discount values.
- Returns:
- validFrom
-
getValidUntil
ZonedDateTime getValidUntil()Date and time (UTC) until which the Discount is effective. Take Eventual Consistency into account for calculated undiscounted values.
- Returns:
- validUntil
-
setId
Unique identifier of the ProductDiscount.
- Specified by:
setIdin interfaceBaseResource- Parameters:
id- value to be set
-
setVersion
Current version of the ProductDiscount.
- Specified by:
setVersionin interfaceBaseResource- Parameters:
version- value to be set
-
setCreatedAt
Date and time (UTC) the ProductDiscount was initially created.
- Specified by:
setCreatedAtin interfaceBaseResource- Parameters:
createdAt- value to be set
-
setLastModifiedAt
Date and time (UTC) the ProductDiscount was last updated.
- Specified by:
setLastModifiedAtin interfaceBaseResource- Parameters:
lastModifiedAt- value to be set
-
setLastModifiedBy
IDs and references that last modified the ProductDiscount.
- Parameters:
lastModifiedBy- value to be set
-
setCreatedBy
IDs and references that created the ProductDiscount.
- Parameters:
createdBy- value to be set
-
setName
Name of the ProductDiscount.
- Parameters:
name- value to be set
-
setKey
User-defined unique identifier of the ProductDiscount.
- Parameters:
key- value to be set
-
setDescription
Description of the ProductDiscount.
- Parameters:
description- value to be set
-
setValue
Type of Discount and its corresponding value.
- Parameters:
value- value to be set
-
setPredicate
Valid ProductDiscount predicate.
- Parameters:
predicate- value to be set
-
setSortOrder
Unique decimal value between 0 and 1 (stored as String literal) defining the order of Product Discounts to apply in case more than one is applicable and active. A Product Discount with a higher value is prioritized.
- Parameters:
sortOrder- value to be set
-
setIsActive
If
truethe Product Discount is applied to Products matching thepredicate.- Parameters:
isActive- value to be set
-
setReferences
References of all the resources that are addressed in the
predicate.- Parameters:
references- values to be set
-
setReferences
References of all the resources that are addressed in the
predicate.- Parameters:
references- values to be set
-
setValidFrom
Date and time (UTC) from which the Discount is effective. Take Eventual Consistency into account for calculated discount values.
- Parameters:
validFrom- value to be set
-
setValidUntil
Date and time (UTC) until which the Discount is effective. Take Eventual Consistency into account for calculated undiscounted values.
- Parameters:
validUntil- value to be set
-
of
factory method- Returns:
- instance of ProductDiscount
-
of
factory method to create a shallow copy ProductDiscount- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
ProductDiscount copyDeep()- Specified by:
copyDeepin interfaceBaseResource
-
deepCopy
factory method to create a deep copy of ProductDiscount- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for ProductDiscount- Returns:
- builder
-
builder
create builder for ProductDiscount instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withProductDiscount
accessor map function- Type Parameters:
T- mapped type- Parameters:
helper- function to map the object- Returns:
- mapped value
-
referenceTypeId
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-