Class PageItemCriteriaImpl
java.lang.Object
org.broadleafcommerce.cms.page.domain.PageItemCriteriaImpl
- All Implemented Interfaces:
Serializable,PageItemCriteria,MultiTenantCloneable<PageItemCriteria>,ProfileEntity,QuantityBasedRule
- Author:
- bpolster
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBuilds a copy of this item.<G extends PageItemCriteria>
CreateResponse<G>Clone this entity for the purpose of multiple tenancy.booleangetId()The primary key value for this rule objectThe rule in the form of an MVEL expressiongetPage()Returns the parentPageto which this field belongs.The quantity for which a match must be found using the rule.inthashCode()voidThe primary key value for this rule objectvoidsetMatchRule(String matchRule) Sets the match rule used to test this item.voidSets the parentPage.voidsetQuantity(Integer receiveQuantity) The quantity for which a match must be found using the rule.
-
Field Details
-
serialVersionUID
public static final long serialVersionUID- See Also:
-
id
-
quantity
-
orderItemMatchRule
-
page
-
-
Constructor Details
-
PageItemCriteriaImpl
public PageItemCriteriaImpl()
-
-
Method Details
-
getId
Description copied from interface:QuantityBasedRuleThe primary key value for this rule object- Specified by:
getIdin interfaceQuantityBasedRule- Returns:
- the primary key value
-
setId
Description copied from interface:QuantityBasedRuleThe primary key value for this rule object- Specified by:
setIdin interfaceQuantityBasedRule- Parameters:
id- the primary key value
-
getQuantity
Description copied from interface:QuantityBasedRuleThe quantity for which a match must be found using the rule. This generally equates to order item quantity (e.g. 2 shirts matching the rule are required in order to receive a discount)- Specified by:
getQuantityin interfaceQuantityBasedRule- Returns:
- the quantity of matches required
-
setQuantity
Description copied from interface:QuantityBasedRuleThe quantity for which a match must be found using the rule. This generally equates to order item quantity (e.g. 2 shirts matching the rule are required in order to receive a discount)- Specified by:
setQuantityin interfaceQuantityBasedRule- Parameters:
receiveQuantity- the quantity of matches required
-
getMatchRule
Description copied from interface:QuantityBasedRuleThe rule in the form of an MVEL expression- Specified by:
getMatchRulein interfaceQuantityBasedRule- Returns:
- the rule as an MVEL string
-
setMatchRule
Description copied from interface:QuantityBasedRuleSets the match rule used to test this item.- Specified by:
setMatchRulein interfaceQuantityBasedRule- Parameters:
matchRule- the rule as an MVEL string
-
getPage
Description copied from interface:PageItemCriteriaReturns the parentPageto which this field belongs.- Specified by:
getPagein interfacePageItemCriteria- Returns:
-
setPage
Description copied from interface:PageItemCriteriaSets the parentPage.- Specified by:
setPagein interfacePageItemCriteria
-
hashCode
public int hashCode() -
equals
-
cloneEntity
Description copied from interface:PageItemCriteriaBuilds a copy of this item. Used by the content management system when an item is edited.- Specified by:
cloneEntityin interfacePageItemCriteria- Returns:
- a copy of this item
-
createOrRetrieveCopyInstance
public <G extends PageItemCriteria> 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<PageItemCriteria>- 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
-