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.boolean
boolean
Deprecated.int
Returns the maximum number of times that this offer can be used in the current order.getOffer()
int
getUses()
int
hashCode()
boolean
Deprecated.void
setApplyDiscountToMarkedItems
(boolean applyDiscountToMarkedItems) Deprecated.void
setMaxUses
(int maxUses) Sets the maximum number of times that this offer can be used in the current order.void
void
setUses
(int uses)
-
Field Details
-
offer
-
uses
protected int uses -
applyDiscountToMarkedItems
Deprecated.
-
-
Constructor Details
-
LegacyOfferUsesImpl
public LegacyOfferUsesImpl()
-
-
Method Details
-
getUses
public int getUses()- Specified by:
getUses
in interfaceLegacyOfferUses
-
setUses
public void setUses(int uses) - Specified by:
setUses
in interfaceLegacyOfferUses
-
getMaxUses
public int getMaxUses()Description copied from interface:LegacyOfferUses
Returns the maximum number of times that this offer can be used in the current order.0 indicates unlimited usage.
- Specified by:
getMaxUses
in interfaceLegacyOfferUses
-
setMaxUses
public void setMaxUses(int maxUses) Description copied from interface:LegacyOfferUses
Sets the maximum number of times that this offer can be used in the current order.0 indicates unlimited usage.
- Specified by:
setMaxUses
in interfaceLegacyOfferUses
-
isApplyDiscountToMarkedItems
Deprecated.Description copied from interface:LegacyOfferUses
This field is not used by BLC.- Specified by:
isApplyDiscountToMarkedItems
in interfaceLegacyOfferUses
- Returns:
-
getApplyDiscountToMarkedItems
Deprecated. -
setApplyDiscountToMarkedItems
Deprecated.Description copied from interface:LegacyOfferUses
This field is not used by BLC.- Specified by:
setApplyDiscountToMarkedItems
in interfaceLegacyOfferUses
-
getOffer
-
setOffer
-
equals
-
hashCode
public int hashCode() -
createOrRetrieveCopyInstance
public <G extends LegacyOfferUses> CreateResponse<G> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException Description copied from interface:MultiTenantCloneable
Clone 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 { CreateResponse
createResponse = context.createOrRetrieveCopyInstance(this); MyClass myClone = createResponse.getClone(); //copy extended field values on myClone here
return createResponse; }
- Specified by:
createOrRetrieveCopyInstance
in 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
-