Class LegacyOfferUsesImpl
java.lang.Object
org.broadleafcommerce.core.offer.domain.LegacyOfferUsesImpl
- All Implemented Interfaces:
MultiTenantCloneable<LegacyOfferUses>,LegacyOfferUses
@Embeddable
public class LegacyOfferUsesImpl
extends Object
implements LegacyOfferUses, MultiTenantCloneable<LegacyOfferUses>
Holds the backwards compatibility field for uses. Also hold the backwards compatibility mutator
implementations for maxUses.
- Author:
- Jeff Fischer
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<G extends LegacyOfferUses>
CreateResponse<G>Clone this entity for the purpose of multiple tenancy.booleanbooleanDeprecated.intReturns the maximum number of times that this offer can be used in the current order.getOffer()intgetUses()inthashCode()booleanDeprecated.voidsetApplyDiscountToMarkedItems(boolean applyDiscountToMarkedItems) Deprecated.voidsetMaxUses(int maxUses) Sets the maximum number of times that this offer can be used in the current order.voidvoidsetUses(int uses)
-
Field Details
-
offer
-
uses
protected int uses -
applyDiscountToMarkedItems
Deprecated.
-
-
Constructor Details
-
LegacyOfferUsesImpl
public LegacyOfferUsesImpl()
-
-
Method Details
-
getUses
public int getUses()- Specified by:
getUsesin interfaceLegacyOfferUses
-
setUses
public void setUses(int uses) - Specified by:
setUsesin interfaceLegacyOfferUses
-
getMaxUses
public int getMaxUses()Description copied from interface:LegacyOfferUsesReturns the maximum number of times that this offer can be used in the current order.0 indicates unlimited usage.
- Specified by:
getMaxUsesin interfaceLegacyOfferUses
-
setMaxUses
public void setMaxUses(int maxUses) Description copied from interface:LegacyOfferUsesSets the maximum number of times that this offer can be used in the current order.0 indicates unlimited usage.
- Specified by:
setMaxUsesin interfaceLegacyOfferUses
-
isApplyDiscountToMarkedItems
Deprecated.Description copied from interface:LegacyOfferUsesThis field is not used by BLC.- Specified by:
isApplyDiscountToMarkedItemsin interfaceLegacyOfferUses- Returns:
-
getApplyDiscountToMarkedItems
Deprecated. -
setApplyDiscountToMarkedItems
Deprecated.Description copied from interface:LegacyOfferUsesThis field is not used by BLC.- Specified by:
setApplyDiscountToMarkedItemsin interfaceLegacyOfferUses
-
getOffer
-
setOffer
-
equals
-
hashCode
public int hashCode() -
createOrRetrieveCopyInstance
public <G extends LegacyOfferUses> CreateResponse<G> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException Description copied from interface:MultiTenantCloneableClone this entity for the purpose of multiple tenancy. Note, extending classes should follow this pattern:public CreateResponse<MyClass> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException { CreateResponse<MyClass> createResponse = super.createOrRetrieveCopyInstance(context); if (createResponse.isAlreadyPopulated()) { return createResponse; } MyClass myClone = createResponse.getClone();Support should also be added for @Embeddable classes that contribute fields (collections or basic) to a cloneable entity://copy extended field values on myClone here
return createResponse; }
public CreateResponse<G extends MyClass> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException { CreateResponsecreateResponse = context.createOrRetrieveCopyInstance(this); MyClass myClone = createResponse.getClone(); //copy extended field values on myClone here
return createResponse; }
- Specified by:
createOrRetrieveCopyInstancein interfaceMultiTenantCloneable<LegacyOfferUses>- Parameters:
context- a context object providing persistence and library functionality for copying entities- Returns:
- the resulting copy container, possibly already persisted
- Throws:
CloneNotSupportedException- if there's a problem detected with the cloning configuration
-