Class StructuredContentItemCriteriaImpl
java.lang.Object
org.broadleafcommerce.cms.structure.domain.StructuredContentItemCriteriaImpl
- All Implemented Interfaces:
Serializable
,StructuredContentItemCriteria
,MultiTenantCloneable<StructuredContentItemCriteria>
,ProfileEntity
,QuantityBasedRule
@Entity
public class StructuredContentItemCriteriaImpl
extends Object
implements StructuredContentItemCriteria, ProfileEntity
- Author:
- jfischer
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Long
protected String
protected Integer
static final long
protected StructuredContent
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBuilds a copy of this item.<G extends StructuredContentItemCriteria>
CreateResponse<G>Clone this entity for the purpose of multiple tenancy.boolean
getId()
The primary key value for this rule objectThe rule in the form of an MVEL expressionThe quantity for which a match must be found using the rule.Returns the parentStructuredContent
item to which this field belongs.int
hashCode()
void
The primary key value for this rule objectvoid
setMatchRule
(String matchRule) Sets the match rule used to test this item.void
setQuantity
(Integer receiveQuantity) The quantity for which a match must be found using the rule.void
setStructuredContent
(StructuredContent structuredContent) Sets the parentStructuredContent
item.
-
Field Details
-
serialVersionUID
public static final long serialVersionUID- See Also:
-
id
-
quantity
-
orderItemMatchRule
-
structuredContent
-
-
Constructor Details
-
StructuredContentItemCriteriaImpl
public StructuredContentItemCriteriaImpl()
-
-
Method Details
-
getId
Description copied from interface:QuantityBasedRule
The primary key value for this rule object- Specified by:
getId
in interfaceQuantityBasedRule
- Returns:
- the primary key value
-
setId
Description copied from interface:QuantityBasedRule
The primary key value for this rule object- Specified by:
setId
in interfaceQuantityBasedRule
- Parameters:
id
- the primary key value
-
getQuantity
Description copied from interface:QuantityBasedRule
The 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:
getQuantity
in interfaceQuantityBasedRule
- Returns:
- the quantity of matches required
-
setQuantity
Description copied from interface:QuantityBasedRule
The 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:
setQuantity
in interfaceQuantityBasedRule
- Parameters:
receiveQuantity
- the quantity of matches required
-
getMatchRule
Description copied from interface:QuantityBasedRule
The rule in the form of an MVEL expression- Specified by:
getMatchRule
in interfaceQuantityBasedRule
- Returns:
- the rule as an MVEL string
-
setMatchRule
Description copied from interface:QuantityBasedRule
Sets the match rule used to test this item.- Specified by:
setMatchRule
in interfaceQuantityBasedRule
- Parameters:
matchRule
- the rule as an MVEL string
-
getStructuredContent
Description copied from interface:StructuredContentItemCriteria
Returns the parentStructuredContent
item to which this field belongs.- Specified by:
getStructuredContent
in interfaceStructuredContentItemCriteria
- Returns:
-
setStructuredContent
Description copied from interface:StructuredContentItemCriteria
Sets the parentStructuredContent
item.- Specified by:
setStructuredContent
in interfaceStructuredContentItemCriteria
-
hashCode
public int hashCode() -
equals
-
cloneEntity
Description copied from interface:StructuredContentItemCriteria
Builds a copy of this item. Used by the content management system when an item is edited.- Specified by:
cloneEntity
in interfaceStructuredContentItemCriteria
- Returns:
- a copy of this item
-
createOrRetrieveCopyInstance
public <G extends StructuredContentItemCriteria> 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<StructuredContentItemCriteria>
- 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
-