Class SharedCode
- java.lang.Object
-
- com.broadleafcommerce.promotion.offer.domain.SharedCode
-
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.EmbeddedContextStateAware,Serializable
public class SharedCode extends Object implements Serializable, com.broadleafcommerce.data.tracking.core.EmbeddedContextStateAware
A simple structure that can be used to represent a code that applies an offer to an order. If a more complex structure is needed or many codes generated, use the Campaign Service.- Author:
- Chad Harchar (charchar)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SharedCode()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(Object other)booleanequals(Object o)StringgetCode()The code string associated to this shared code and used to apply the associated offer to an order.com.broadleafcommerce.data.tracking.core.EmbeddedContextStategetContextState()A subset ofTrackinginformation to expose the context state for this object.intgetMaxUses()Defines the maximum number of times that this code can be used regardless of Order or Customer.inthashCode()voidsetCode(String code)The code string associated to this shared code and used to apply the associated offer to an order.voidsetContextState(com.broadleafcommerce.data.tracking.core.EmbeddedContextState contextState)A subset ofTrackinginformation to expose the context state for this object.voidsetMaxUses(int maxUses)Defines the maximum number of times that this code can be used regardless of Order or Customer.StringtoString()
-
-
-
Method Detail
-
getCode
public String getCode()
The code string associated to this shared code and used to apply the associated offer to an order.- Returns:
- The code string associated to this shared code and used to apply the associated offer to an order.
-
getMaxUses
public int getMaxUses()
Defines the maximum number of times that this code can be used regardless of Order or Customer. The value of 0 indicates unlimited usage.- Returns:
- the maximum number of times that this code can be used regardless of Order or Customer.
-
getContextState
public com.broadleafcommerce.data.tracking.core.EmbeddedContextState getContextState()
A subset ofTrackinginformation to expose the context state for this object. This value is not persisted, and instead it is dynamically calculated and populated when theChangeDetailsfor the parent object's entireattributesmap are compared.- Specified by:
getContextStatein interfacecom.broadleafcommerce.data.tracking.core.EmbeddedContextStateAware- Returns:
- a subset of
Trackinginformation to expose the context state for this object
-
setCode
public void setCode(String code)
The code string associated to this shared code and used to apply the associated offer to an order.- Parameters:
code- The code string associated to this shared code and used to apply the associated offer to an order.
-
setMaxUses
public void setMaxUses(int maxUses)
Defines the maximum number of times that this code can be used regardless of Order or Customer. The value of 0 indicates unlimited usage.- Parameters:
maxUses- the maximum number of times that this code can be used regardless of Order or Customer.
-
setContextState
public void setContextState(com.broadleafcommerce.data.tracking.core.EmbeddedContextState contextState)
A subset ofTrackinginformation to expose the context state for this object. This value is not persisted, and instead it is dynamically calculated and populated when theChangeDetailsfor the parent object's entireattributesmap are compared.- Specified by:
setContextStatein interfacecom.broadleafcommerce.data.tracking.core.EmbeddedContextStateAware- Parameters:
contextState- a subset ofTrackinginformation to expose the context state for this object
-
canEqual
protected boolean canEqual(Object other)
-
-