Interface CountOnLineItemUnits
- All Superinterfaces:
PatternComponent
Example to create an instance using the builder pattern
CountOnLineItemUnits countOnLineItemUnits = CountOnLineItemUnits.builder()
.predicate("{predicate}")
.build()
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
discriminator value for CountOnLineItemUnits -
Method Summary
Modifier and TypeMethodDescriptionstatic CountOnLineItemUnitsBuilder
builder()
builder factory method for CountOnLineItemUnitsstatic CountOnLineItemUnitsBuilder
builder
(CountOnLineItemUnits template) create builder for CountOnLineItemUnits instancestatic CountOnLineItemUnits
deepCopy
(CountOnLineItemUnits template) factory method to create a deep copy of CountOnLineItemUnitsNumber of units of a Line Item to exclude on every application of the Discount.Maximum number of units of a Line Item that match the predicate.Minimum number of units of a Line Item that match the predicate.@NotNull String
Valid LineItem predicate that determines the units participating in the Discount.static CountOnLineItemUnits
of()
factory methodstatic CountOnLineItemUnits
of
(CountOnLineItemUnits template) factory method to create a shallow copy CountOnLineItemUnitsvoid
setExcludeCount
(Integer excludeCount) Number of units of a Line Item to exclude on every application of the Discount.void
setMaxCount
(Integer maxCount) Maximum number of units of a Line Item that match the predicate.void
setMinCount
(Integer minCount) Minimum number of units of a Line Item that match the predicate.void
setPredicate
(String predicate) Valid LineItem predicate that determines the units participating in the Discount.static com.fasterxml.jackson.core.type.TypeReference<CountOnLineItemUnits>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withCountOnLineItemUnits
(Function<CountOnLineItemUnits, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.cart_discount.PatternComponent
getType, withPatternComponent
-
Field Details
-
COUNT_ON_LINE_ITEM_UNITS
discriminator value for CountOnLineItemUnits- See Also:
-
-
Method Details
-
getPredicate
Valid LineItem predicate that determines the units participating in the Discount.
- Returns:
- predicate
-
getMinCount
Integer getMinCount()Minimum number of units of a Line Item that match the predicate.
- Returns:
- minCount
-
getMaxCount
Integer getMaxCount()Maximum number of units of a Line Item that match the predicate. There might be more units matching the predicate, but they will not be participating to the resulting set.
The value must be greater than or equal to
minCount
. If not provided, the component will match all units that satisfy the predicate.- Returns:
- maxCount
-
getExcludeCount
Integer getExcludeCount()Number of units of a Line Item to exclude on every application of the Discount.
Set only when configuring the
targetPattern
.The units matched first (satisfying the pattern component) will be excluded from the resulting set. The
minCount
andmaxCount
are considered only after the exclusion. Pattern components are matched only if any further units satisfying the pattern component exist. For example, if 5 jeans are required but only 3 should be discounted, theexcludeCount
value must be 2.- Returns:
- excludeCount
-
setPredicate
Valid LineItem predicate that determines the units participating in the Discount.
- Parameters:
predicate
- value to be set
-
setMinCount
Minimum number of units of a Line Item that match the predicate.
- Parameters:
minCount
- value to be set
-
setMaxCount
Maximum number of units of a Line Item that match the predicate. There might be more units matching the predicate, but they will not be participating to the resulting set.
The value must be greater than or equal to
minCount
. If not provided, the component will match all units that satisfy the predicate.- Parameters:
maxCount
- value to be set
-
setExcludeCount
Number of units of a Line Item to exclude on every application of the Discount.
Set only when configuring the
targetPattern
.The units matched first (satisfying the pattern component) will be excluded from the resulting set. The
minCount
andmaxCount
are considered only after the exclusion. Pattern components are matched only if any further units satisfying the pattern component exist. For example, if 5 jeans are required but only 3 should be discounted, theexcludeCount
value must be 2.- Parameters:
excludeCount
- value to be set
-
of
factory method- Returns:
- instance of CountOnLineItemUnits
-
of
factory method to create a shallow copy CountOnLineItemUnits- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of CountOnLineItemUnits- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for CountOnLineItemUnits- Returns:
- builder
-
builder
create builder for CountOnLineItemUnits instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withCountOnLineItemUnits
accessor map function- Type Parameters:
T
- mapped type- Parameters:
helper
- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-