public class XPFPromotionRule extends XPFEntity
| Modifier and Type | Class and Description |
|---|---|
static class |
XPFPromotionRule.XPFPromotionRuleBuilder<C extends XPFPromotionRule,B extends XPFPromotionRule.XPFPromotionRuleBuilder<C,B>> |
XPFEntity.XPFEntityBuilder<C extends XPFEntity,B extends XPFEntity.XPFEntityBuilder<C,B>>| Modifier | Constructor and Description |
|---|---|
|
XPFPromotionRule(@NonNull String code,
@NonNull String name,
@NonNull String type,
String description,
@NonNull String startDate,
String endDate,
XPFPromotionElementGroup rootConditionGroup,
@NonNull XPFPromotionOperatorEnum conditionalOperator,
@NonNull List<XPFPromotionElement> conditions,
@NonNull List<XPFPromotionElement> actions,
@NonNull XPFEntitySupplier<Map<Locale,String>> displayNames,
@NonNull XPFEntitySupplier<Map<Locale,String>> carrotDescriptions) |
protected |
XPFPromotionRule(XPFPromotionRule.XPFPromotionRuleBuilder<?,?> b) |
| Modifier and Type | Method and Description |
|---|---|
static XPFPromotionRule.XPFPromotionRuleBuilder<?,?> |
builder() |
protected boolean |
canEqual(Object other) |
boolean |
equals(Object o) |
@NonNull List<XPFPromotionElement> |
getActions()
The list of actions for the promotion rule.
|
Optional<String> |
getCarrotDescription(Locale locale)
Get localized carrot description for a locale with fallback behavior.
|
Map<Locale,String> |
getCarrotDescriptions()
Get the carrot descriptions.
|
@NonNull String |
getCode()
The unique code of the promotion rule.
|
@NonNull XPFPromotionOperatorEnum |
getConditionalOperator()
Deprecated.
Use getRootConditionGroup().getOperator() instead.
|
@NonNull List<XPFPromotionElement> |
getConditions()
Deprecated.
Use getRootConditionGroup().getConditions() as well as getRootConditionGroup().getChildGroups() instead.
|
String |
getDescription()
The description of the promotion rule.
|
Optional<String> |
getDisplayName(Locale locale)
Get localized display name for a locale with fallback behavior.
|
Map<Locale,String> |
getDisplayNames()
Get the display names.
|
String |
getEndDate()
The end date of the promotion rule.
|
@NonNull String |
getName()
The name of the promotion rule.
|
XPFPromotionElementGroup |
getRootConditionGroup()
The hierarchical root condition group of the promotion rule.
|
@NonNull String |
getStartDate()
The start date of the promotion rule.
|
@NonNull String |
getType()
The type of the promotion rule, which identifies the rule set and determines the promotion's context and behavior.
|
int |
hashCode() |
String |
toString() |
getCustomData, getCustomDataValueprotected XPFPromotionRule(XPFPromotionRule.XPFPromotionRuleBuilder<?,?> b)
public XPFPromotionRule(@NonNull
@NonNull String code,
@NonNull
@NonNull String name,
@NonNull
@NonNull String type,
String description,
@NonNull
@NonNull String startDate,
String endDate,
XPFPromotionElementGroup rootConditionGroup,
@NonNull
@NonNull XPFPromotionOperatorEnum conditionalOperator,
@NonNull
@NonNull List<XPFPromotionElement> conditions,
@NonNull
@NonNull List<XPFPromotionElement> actions,
@NonNull
@NonNull XPFEntitySupplier<Map<Locale,String>> displayNames,
@NonNull
@NonNull XPFEntitySupplier<Map<Locale,String>> carrotDescriptions)
public Map<Locale,String> getDisplayNames()
public Optional<String> getDisplayName(Locale locale)
locale - The locale to get a display name for.public Map<Locale,String> getCarrotDescriptions()
public Optional<String> getCarrotDescription(Locale locale)
locale - The locale to get a carrot description for.public static XPFPromotionRule.XPFPromotionRuleBuilder<?,?> builder()
@NonNull public @NonNull String getCode()
@NonNull public @NonNull String getName()
@NonNull public @NonNull String getType()
This field is expected to contain one of these values:
This type influences:
public String getDescription()
@NonNull public @NonNull String getStartDate()
public String getEndDate()
public XPFPromotionElementGroup getRootConditionGroup()
null for
legacy promotions that have no conditions yet (no root group has been materialised).
Plugins consuming the AND/OR tree should walk from this root via
XPFPromotionElementGroup.getChildGroups() and
XPFPromotionElementGroup.getConditions().@Deprecated @NonNull public @NonNull XPFPromotionOperatorEnum getConditionalOperator()
getRootConditionGroup()'s operator and is
retained for backward compatibility with consumers of the flat getConditions() list.@Deprecated @NonNull public @NonNull List<XPFPromotionElement> getConditions()
getRootConditionGroup() instead.@NonNull public @NonNull List<XPFPromotionElement> getActions()
Copyright © 2026. All rights reserved.