org.broadleafcommerce.core.offer.domain
Class OfferImpl

java.lang.Object
  extended by org.broadleafcommerce.core.offer.domain.OfferImpl
All Implemented Interfaces:
Serializable, AdminMainEntity, Status, Offer

@Entity
public class OfferImpl
extends Object
implements Offer, Status, AdminMainEntity

See Also:
Serialized Form

Nested Class Summary
static class OfferImpl.Presentation
           
 
Field Summary
protected  String appliesToCustomerRules
          Deprecated. 
protected  String appliesToOrderRules
          Deprecated. 
protected  boolean applyDiscountToMarkedItems
          Deprecated. 
protected  Boolean applyToSalePrice
           
protected  ArchiveStatus archiveStatus
           
protected  Boolean automaticallyAdded
           
protected  Boolean combinableWithOtherOffers
          No offers can be applied on top of this offer; If false, stackable has to be false also
protected  String deliveryType
           
protected  String description
           
protected  String discountType
           
protected  Date endDate
           
protected  Long id
           
protected  String marketingMessage
           
protected  Long maxUsesPerCustomer
           
protected  Integer maxUsesPerOrder
           
protected  String name
           
protected  List<OfferCode> offerCodes
           
protected  String offerItemQualifierRuleType
           
protected  String offerItemTargetRuleType
           
protected  Integer priority
           
protected  Set<OfferItemCriteria> qualifyingItemCriteria
           
protected  BigDecimal qualifyingItemSubTotal
           
static long serialVersionUID
           
protected  Boolean stackable
           
protected  Date startDate
           
protected  Set<OfferItemCriteria> targetItemCriteria
           
protected  String targetSystem
           
protected  Boolean totalitarianOffer
           
protected  Boolean treatAsNewFormat
           
protected  String type
           
protected  int uses
          Deprecated. 
protected  BigDecimal value
           
 
Fields inherited from interface org.broadleafcommerce.common.admin.domain.AdminMainEntity
MAIN_ENTITY_NAME_PROPERTY
 
Constructor Summary
OfferImpl()
           
 
Method Summary
 boolean equals(Object obj)
           
 String getAppliesToCustomerRules()
          Deprecated. 
 String getAppliesToOrderRules()
          Deprecated. 
 boolean getApplyDiscountToMarkedItems()
          Deprecated. 
 boolean getApplyDiscountToSalePrice()
           
 Character getArchived()
           
 boolean getCombinableWithOtherOffers()
          Deprecated. 
 OfferDeliveryType getDeliveryType()
          Deprecated. 
 String getDescription()
           
 OfferDiscountType getDiscountType()
           
 Date getEndDate()
           
 Long getId()
           
 String getMainEntityName()
           
 String getMarketingMessage()
           
 int getMaxUses()
          Returns the maximum number of times that this offer can be used in the current order.
 Long getMaxUsesPerCustomer()
          Returns the maximum number of times that this offer can be used by the same customer.
 int getMaxUsesPerOrder()
           
 String getName()
           
 List<OfferCode> getOfferCodes()
           
 OfferItemRestrictionRuleType getOfferItemQualifierRuleType()
           
 OfferItemRestrictionRuleType getOfferItemTargetRuleType()
           
 Map<String,OfferRule> getOfferMatchRules()
           
 int getPriority()
           
 Set<OfferItemCriteria> getQualifyingItemCriteria()
           
 Money getQualifyingItemSubTotal()
          Indicates the amount of items that must be purchased for this offer to be considered for this order.
 boolean getStackable()
          Deprecated. 
 Date getStartDate()
           
 Set<OfferItemCriteria> getTargetItemCriteria()
           
 String getTargetSystem()
           
 Boolean getTreatAsNewFormat()
           
 OfferType getType()
           
 int getUses()
          Deprecated. 
 BigDecimal getValue()
           
 int hashCode()
           
 boolean isActive()
           
 boolean isApplyDiscountToMarkedItems()
          Deprecated. 
 boolean isAutomaticallyAdded()
          Returns true if the offer system should automatically add this offer for consideration (versus requiring a code or other delivery mechanism).
 boolean isCombinableWithOtherOffers()
          Returns true if this offer can be combined with other offers in the order.
 boolean isStackable()
          Returns true if this offer can be stacked on top of another offer.
 Boolean isTotalitarianOffer()
           
 void setAppliesToCustomerRules(String appliesToCustomerRules)
          Deprecated. 
 void setAppliesToOrderRules(String appliesToOrderRules)
          Deprecated. 
 void setApplyDiscountToMarkedItems(boolean applyDiscountToMarkedItems)
          Deprecated. 
 void setApplyDiscountToSalePrice(boolean applyToSalePrice)
           
 void setArchived(Character archived)
           
 void setAutomaticallyAdded(boolean automaticallyAdded)
          Sets whether or not this offer should be automatically considered for consideration (versus requiring a code or other delivery mechanism).
 void setCombinableWithOtherOffers(boolean combinableWithOtherOffers)
          Sets the combinableWithOtherOffers value for this offer.
 void setDeliveryType(OfferDeliveryType deliveryType)
           
 void setDescription(String description)
           
 void setDiscountType(OfferDiscountType discountType)
           
 void setEndDate(Date endDate)
           
 void setId(Long id)
           
 void setMarketingMessage(String marketingMessage)
           
 void setMaxUses(int maxUses)
          Sets the maximum number of times that this offer can be used in the current order.
 void setMaxUsesPerCustomer(Long maxUsesPerCustomer)
          Sets the maximum number of times that this offer can be used by the same customer.
 void setMaxUsesPerOrder(int maxUsesPerOrder)
           
 void setName(String name)
           
 void setOfferCodes(List<OfferCode> offerCodes)
           
 void setOfferItemQualifierRuleType(OfferItemRestrictionRuleType restrictionRuleType)
           
 void setOfferItemTargetRuleType(OfferItemRestrictionRuleType restrictionRuleType)
           
 void setOfferMatchRules(Map<String,OfferRule> offerMatchRules)
           
 void setPriority(int priority)
           
 void setQualifyingItemCriteria(Set<OfferItemCriteria> qualifyingItemCriteria)
           
 void setQualifyingItemSubTotal(Money qualifyingItemSubTotal)
           
 void setStackable(boolean stackable)
          Sets the stackable value for this offer.
 void setStartDate(Date startDate)
           
 void setTargetItemCriteria(Set<OfferItemCriteria> targetItemCriteria)
           
 void setTargetSystem(String targetSystem)
           
 void setTotalitarianOffer(Boolean totalitarianOffer)
           
 void setTreatAsNewFormat(Boolean treatAsNewFormat)
           
 void setType(OfferType type)
           
 void setUses(int uses)
          Deprecated. 
 void setValue(BigDecimal value)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values

id

protected Long id

offerCodes

protected List<OfferCode> offerCodes

name

protected String name

description

protected String description

marketingMessage

protected String marketingMessage

type

protected String type

discountType

protected String discountType

value

protected BigDecimal value

priority

protected Integer priority

startDate

protected Date startDate

endDate

protected Date endDate

stackable

protected Boolean stackable

targetSystem

protected String targetSystem

applyToSalePrice

protected Boolean applyToSalePrice

appliesToOrderRules

@Deprecated
protected String appliesToOrderRules
Deprecated. 

appliesToCustomerRules

@Deprecated
protected String appliesToCustomerRules
Deprecated. 

applyDiscountToMarkedItems

@Deprecated
protected boolean applyDiscountToMarkedItems
Deprecated. 

combinableWithOtherOffers

protected Boolean combinableWithOtherOffers
No offers can be applied on top of this offer; If false, stackable has to be false also


deliveryType

protected String deliveryType

automaticallyAdded

protected Boolean automaticallyAdded

maxUsesPerOrder

protected Integer maxUsesPerOrder

maxUsesPerCustomer

protected Long maxUsesPerCustomer

uses

@Deprecated
protected int uses
Deprecated. 

offerItemQualifierRuleType

protected String offerItemQualifierRuleType

offerItemTargetRuleType

protected String offerItemTargetRuleType

qualifyingItemCriteria

protected Set<OfferItemCriteria> qualifyingItemCriteria

targetItemCriteria

protected Set<OfferItemCriteria> targetItemCriteria

totalitarianOffer

protected Boolean totalitarianOffer

treatAsNewFormat

protected Boolean treatAsNewFormat

qualifyingItemSubTotal

protected BigDecimal qualifyingItemSubTotal

archiveStatus

protected ArchiveStatus archiveStatus
Constructor Detail

OfferImpl

public OfferImpl()
Method Detail

getOfferCodes

public List<OfferCode> getOfferCodes()

setOfferCodes

public void setOfferCodes(List<OfferCode> offerCodes)

getId

public Long getId()
Specified by:
getId in interface Offer

setId

public void setId(Long id)
Specified by:
setId in interface Offer

getName

public String getName()
Specified by:
getName in interface Offer

setName

public void setName(String name)
Specified by:
setName in interface Offer

getDescription

public String getDescription()
Specified by:
getDescription in interface Offer

setDescription

public void setDescription(String description)
Specified by:
setDescription in interface Offer

getType

public OfferType getType()
Specified by:
getType in interface Offer

setType

public void setType(OfferType type)
Specified by:
setType in interface Offer

getDiscountType

public OfferDiscountType getDiscountType()
Specified by:
getDiscountType in interface Offer

setDiscountType

public void setDiscountType(OfferDiscountType discountType)
Specified by:
setDiscountType in interface Offer

getOfferItemQualifierRuleType

public OfferItemRestrictionRuleType getOfferItemQualifierRuleType()
Specified by:
getOfferItemQualifierRuleType in interface Offer

setOfferItemQualifierRuleType

public void setOfferItemQualifierRuleType(OfferItemRestrictionRuleType restrictionRuleType)
Specified by:
setOfferItemQualifierRuleType in interface Offer

getOfferItemTargetRuleType

public OfferItemRestrictionRuleType getOfferItemTargetRuleType()
Specified by:
getOfferItemTargetRuleType in interface Offer

setOfferItemTargetRuleType

public void setOfferItemTargetRuleType(OfferItemRestrictionRuleType restrictionRuleType)
Specified by:
setOfferItemTargetRuleType in interface Offer

getValue

public BigDecimal getValue()
Specified by:
getValue in interface Offer

setValue

public void setValue(BigDecimal value)
Specified by:
setValue in interface Offer

getPriority

public int getPriority()
Specified by:
getPriority in interface Offer

setPriority

public void setPriority(int priority)
Specified by:
setPriority in interface Offer

getStartDate

public Date getStartDate()
Specified by:
getStartDate in interface Offer

setStartDate

public void setStartDate(Date startDate)
Specified by:
setStartDate in interface Offer

getEndDate

public Date getEndDate()
Specified by:
getEndDate in interface Offer

setEndDate

public void setEndDate(Date endDate)
Specified by:
setEndDate in interface Offer

isStackable

public boolean isStackable()
Returns true if this offer can be stacked on top of another offer. Stackable is evaluated against offers with the same offer type.

Specified by:
isStackable in interface Offer
Returns:
true if stackable, otherwise false

setStackable

public void setStackable(boolean stackable)
Sets the stackable value for this offer.

Specified by:
setStackable in interface Offer
Parameters:
stackable -

getStackable

@Deprecated
public boolean getStackable()
Deprecated. 


getTargetSystem

public String getTargetSystem()
Specified by:
getTargetSystem in interface Offer

setTargetSystem

public void setTargetSystem(String targetSystem)
Specified by:
setTargetSystem in interface Offer

getApplyDiscountToSalePrice

public boolean getApplyDiscountToSalePrice()
Specified by:
getApplyDiscountToSalePrice in interface Offer

setApplyDiscountToSalePrice

public void setApplyDiscountToSalePrice(boolean applyToSalePrice)
Specified by:
setApplyDiscountToSalePrice in interface Offer

getAppliesToOrderRules

@Deprecated
public String getAppliesToOrderRules()
Deprecated. 

Specified by:
getAppliesToOrderRules in interface Offer

setAppliesToOrderRules

@Deprecated
public void setAppliesToOrderRules(String appliesToOrderRules)
Deprecated. 

Specified by:
setAppliesToOrderRules in interface Offer

getAppliesToCustomerRules

@Deprecated
public String getAppliesToCustomerRules()
Deprecated. 

Specified by:
getAppliesToCustomerRules in interface Offer

setAppliesToCustomerRules

@Deprecated
public void setAppliesToCustomerRules(String appliesToCustomerRules)
Deprecated. 

Specified by:
setAppliesToCustomerRules in interface Offer

isApplyDiscountToMarkedItems

@Deprecated
public boolean isApplyDiscountToMarkedItems()
Deprecated. 

Specified by:
isApplyDiscountToMarkedItems in interface Offer

getApplyDiscountToMarkedItems

@Deprecated
public boolean getApplyDiscountToMarkedItems()
Deprecated. 


setApplyDiscountToMarkedItems

@Deprecated
public void setApplyDiscountToMarkedItems(boolean applyDiscountToMarkedItems)
Deprecated. 

Specified by:
setApplyDiscountToMarkedItems in interface Offer

isCombinableWithOtherOffers

public boolean isCombinableWithOtherOffers()
Returns true if this offer can be combined with other offers in the order.

Specified by:
isCombinableWithOtherOffers in interface Offer
Returns:
true if combinableWithOtherOffers, otherwise false

setCombinableWithOtherOffers

public void setCombinableWithOtherOffers(boolean combinableWithOtherOffers)
Sets the combinableWithOtherOffers value for this offer.

Specified by:
setCombinableWithOtherOffers in interface Offer
Parameters:
combinableWithOtherOffers -

getCombinableWithOtherOffers

@Deprecated
public boolean getCombinableWithOtherOffers()
Deprecated. 


isAutomaticallyAdded

public boolean isAutomaticallyAdded()
Description copied from interface: Offer
Returns true if the offer system should automatically add this offer for consideration (versus requiring a code or other delivery mechanism). This does not guarantee that the offer will qualify. All rules associated with this offer must still pass. A true value here just means that the offer will be considered. For backwards compatibility, if the underlying property is null, this method will check the Offer.getDeliveryType() method and return true if that value is set to AUTOMATIC. If still null, this value will return false.

Specified by:
isAutomaticallyAdded in interface Offer
Returns:

setAutomaticallyAdded

public void setAutomaticallyAdded(boolean automaticallyAdded)
Description copied from interface: Offer
Sets whether or not this offer should be automatically considered for consideration (versus requiring a code or other delivery mechanism).

Specified by:
setAutomaticallyAdded in interface Offer
See Also:
Offer.isAutomaticallyAdded()

getDeliveryType

@Deprecated
public OfferDeliveryType getDeliveryType()
Deprecated. 

Specified by:
getDeliveryType in interface Offer
Returns:

setDeliveryType

public void setDeliveryType(OfferDeliveryType deliveryType)
Specified by:
setDeliveryType in interface Offer

getMaxUsesPerCustomer

public Long getMaxUsesPerCustomer()
Description copied from interface: Offer
Returns the maximum number of times that this offer can be used by the same customer. This field tracks the number of times the offer can be used and not how many times it is applied. 0 or null indicates unlimited usage per customer.

Specified by:
getMaxUsesPerCustomer in interface Offer
Returns:

setMaxUsesPerCustomer

public void setMaxUsesPerCustomer(Long maxUsesPerCustomer)
Description copied from interface: Offer
Sets the maximum number of times that this offer can be used by the same customer. Intended as a transient field that gets derived from the other persisted max uses fields including maxUsesPerOrder and maxUsesPerCustomer. 0 or null indicates unlimited usage.

Specified by:
setMaxUsesPerCustomer in interface Offer

getMaxUsesPerOrder

public int getMaxUsesPerOrder()

setMaxUsesPerOrder

public void setMaxUsesPerOrder(int maxUsesPerOrder)

getMaxUses

public int getMaxUses()
Description copied from interface: Offer
Returns the maximum number of times that this offer can be used in the current order. 0 indicates unlimited usage.

Specified by:
getMaxUses in interface Offer
Returns:

setMaxUses

public void setMaxUses(int maxUses)
Description copied from interface: Offer
Sets the maximum number of times that this offer can be used in the current order. 0 indicates unlimited usage.

Specified by:
setMaxUses in interface Offer

getUses

@Deprecated
public int getUses()
Deprecated. 

Specified by:
getUses in interface Offer

getMarketingMessage

public String getMarketingMessage()
Specified by:
getMarketingMessage in interface Offer

setMarketingMessage

public void setMarketingMessage(String marketingMessage)
Specified by:
setMarketingMessage in interface Offer

setUses

@Deprecated
public void setUses(int uses)
Deprecated. 

Specified by:
setUses in interface Offer

getQualifyingItemCriteria

public Set<OfferItemCriteria> getQualifyingItemCriteria()
Specified by:
getQualifyingItemCriteria in interface Offer

setQualifyingItemCriteria

public void setQualifyingItemCriteria(Set<OfferItemCriteria> qualifyingItemCriteria)
Specified by:
setQualifyingItemCriteria in interface Offer

getTargetItemCriteria

public Set<OfferItemCriteria> getTargetItemCriteria()
Specified by:
getTargetItemCriteria in interface Offer

setTargetItemCriteria

public void setTargetItemCriteria(Set<OfferItemCriteria> targetItemCriteria)
Specified by:
setTargetItemCriteria in interface Offer

isTotalitarianOffer

public Boolean isTotalitarianOffer()
Specified by:
isTotalitarianOffer in interface Offer

setTotalitarianOffer

public void setTotalitarianOffer(Boolean totalitarianOffer)
Specified by:
setTotalitarianOffer in interface Offer

getOfferMatchRules

public Map<String,OfferRule> getOfferMatchRules()
Specified by:
getOfferMatchRules in interface Offer

setOfferMatchRules

public void setOfferMatchRules(Map<String,OfferRule> offerMatchRules)
Specified by:
setOfferMatchRules in interface Offer

getTreatAsNewFormat

public Boolean getTreatAsNewFormat()
Specified by:
getTreatAsNewFormat in interface Offer

setTreatAsNewFormat

public void setTreatAsNewFormat(Boolean treatAsNewFormat)
Specified by:
setTreatAsNewFormat in interface Offer

getArchived

public Character getArchived()
Specified by:
getArchived in interface Status

setArchived

public void setArchived(Character archived)
Specified by:
setArchived in interface Status

isActive

public boolean isActive()
Specified by:
isActive in interface Status

getQualifyingItemSubTotal

public Money getQualifyingItemSubTotal()
Description copied from interface: Offer
Indicates the amount of items that must be purchased for this offer to be considered for this order. The system will find all qualifying items for the given offer and sum their prices before any discounts are applied to make the determination. If the sum of the qualifying items is not greater than this value the offer is not considered by the offer processing algorithm.

Specified by:
getQualifyingItemSubTotal in interface Offer
Returns:

setQualifyingItemSubTotal

public void setQualifyingItemSubTotal(Money qualifyingItemSubTotal)
Specified by:
setQualifyingItemSubTotal in interface Offer

getMainEntityName

public String getMainEntityName()
Specified by:
getMainEntityName in interface AdminMainEntity

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2013. All Rights Reserved.