Class OfferRef
java.lang.Object
com.broadleafcommerce.promotion.offer.client.web.context.info.OfferRef
- All Implemented Interfaces:
Serializable
Slimmed-down reference to an offer.
- Author:
- Nathan Moore (nathanmoore).
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanDynamic attributes that are a part of the offer.The tracking identifiers of the campaigns of which this offer is a part.A label for this offer typically used by the storefront.Description of this offer.getId()The context ID of the offer.getName()Display name for this offer.Determines how an offer's discount amount is distributed across the offer's related order item types.inthashCode()booleanWhether the offer is marked as combinable, meaning that it can be combined with other offers.booleanFuture credit means that the associated adjustment will be discounted at a later time to the user via a credit.booleanDeprecated.since 1.6, in favor of offer stacking and combinabilitybooleanWhether the offer is marked as totalitarian, meaning that it can be the only offer applied..voidsetAttributes(Map<String, Object> attributes) Dynamic attributes that are a part of the offer.voidsetCampaignTrackingIds(Set<String> campaignTrackingIds) The tracking identifiers of the campaigns of which this offer is a part.voidsetCartLabel(String cartLabel) A label for this offer typically used by the storefront.voidsetCombinable(boolean combinable) Whether the offer is marked as combinable, meaning that it can be combined with other offers.voidsetDescription(String description) Description of this offer.voidsetFutureCredit(boolean futureCredit) Future credit means that the associated adjustment will be discounted at a later time to the user via a credit.voidThe context ID of the offer.voidDisplay name for this offer.voidsetProrationType(String prorationType) Determines how an offer's discount amount is distributed across the offer's related order item types.voidsetTargetsCanBeTargets(boolean targetsCanBeTargets) Deprecated.since 1.6, in favor of offer stacking and combinabilityvoidsetTotalitarian(boolean totalitarian) Whether the offer is marked as totalitarian, meaning that it can be the only offer applied..toString()
-
Constructor Details
-
OfferRef
public OfferRef()
-
-
Method Details
-
getId
The context ID of the offer.- Returns:
- the context ID of the offer.
-
getName
Display name for this offer.- Returns:
- the name of this offer
-
getDescription
Description of this offer.- Returns:
- Description of this offer.
-
isTotalitarian
public boolean isTotalitarian()Whether the offer is marked as totalitarian, meaning that it can be the only offer applied..- Returns:
- Whether the offer is marked as totalitarian, meaning that it can be the only offer applied.
-
isCombinable
public boolean isCombinable()Whether the offer is marked as combinable, meaning that it can be combined with other offers.- Returns:
- Whether the offer is marked as combinable, meaning that it can be combined with other offers.
-
isFutureCredit
public boolean isFutureCredit()Future credit means that the associated adjustment will be discounted at a later time to the user via a credit. It is up to the implementor to decide how to achieve this.- Returns:
- Whether the offer is to be discounted at a later time and date.
-
isTargetsCanBeTargets
Deprecated.since 1.6, in favor of offer stacking and combinabilityDetermines whether items that this offer targets to receive its discount can also receive discounts from other offers. For example, if this offer targets all "red t-shirts" with a 10% discount and another offer targets all "shirts" for a $5 discount, then this field determines whether that "red t-shirt" receives both discounts (whatever the best combination of the 2 is) or only the better offer of the 2. Default is false: A target can only receive a discount from 1 offer (the best one).- Returns:
- Determines whether items that this offer targets to receive its discount can also receive discounts from other offers.
-
getCartLabel
A label for this offer typically used by the storefront.- Returns:
- A label for this offer typically used by the storefront.
-
getProrationType
Determines how an offer's discount amount is distributed across the offer's related order item types. This can either be set to prorate across target items or target and qualifier items.This property is used downstream in `OrderOperationServices` or other custom services to calculate the proper refund amounts when factoring in offer discounts.
- Returns:
- The type of order items that this discount is prorated across.
-
getCampaignTrackingIds
The tracking identifiers of the campaigns of which this offer is a part. Seecom.broadleafcommerce.promotion.campaign.domain.Campaign#id- Returns:
- The tracking codes of the campaigns of which this offer is a part
-
getAttributes
Dynamic attributes that are a part of the offer.- Returns:
- dynamic attributes that are a part of the offer
-
setId
The context ID of the offer.- Parameters:
id- the context ID of the offer.
-
setName
Display name for this offer.- Parameters:
name- the name of this offer
-
setDescription
Description of this offer.- Parameters:
description- Description of this offer.
-
setTotalitarian
public void setTotalitarian(boolean totalitarian) Whether the offer is marked as totalitarian, meaning that it can be the only offer applied..- Parameters:
totalitarian- Whether the offer is marked as totalitarian, meaning that it can be the only offer applied.
-
setCombinable
public void setCombinable(boolean combinable) Whether the offer is marked as combinable, meaning that it can be combined with other offers.- Parameters:
combinable- Whether the offer is marked as combinable, meaning that it can be combined with other offers.
-
setFutureCredit
public void setFutureCredit(boolean futureCredit) Future credit means that the associated adjustment will be discounted at a later time to the user via a credit. It is up to the implementor to decide how to achieve this.- Parameters:
futureCredit- Whether the offer is to be discounted at a later time and date.
-
setTargetsCanBeTargets
Deprecated.since 1.6, in favor of offer stacking and combinabilityDetermines whether items that this offer targets to receive its discount can also receive discounts from other offers. For example, if this offer targets all "red t-shirts" with a 10% discount and another offer targets all "shirts" for a $5 discount, then this field determines whether that "red t-shirt" receives both discounts (whatever the best combination of the 2 is) or only the better offer of the 2. Default is false: A target can only receive a discount from 1 offer (the best one).- Parameters:
targetsCanBeTargets- Determines whether items that this offer targets to receive its discount can also receive discounts from other offers.
-
setCartLabel
A label for this offer typically used by the storefront.- Parameters:
cartLabel- A label for this offer typically used by the storefront.
-
setProrationType
Determines how an offer's discount amount is distributed across the offer's related order item types. This can either be set to prorate across target items or target and qualifier items.This property is used downstream in `OrderOperationServices` or other custom services to calculate the proper refund amounts when factoring in offer discounts.
- Parameters:
prorationType- The type of order items that this discount is prorated across.
-
setCampaignTrackingIds
The tracking identifiers of the campaigns of which this offer is a part. Seecom.broadleafcommerce.promotion.campaign.domain.Campaign#id -
setAttributes
Dynamic attributes that are a part of the offer.- Parameters:
attributes- dynamic attributes that are a part of the offer
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-