Interface OrderPartOfMembersCloningStrategy
-
- All Known Implementing Classes:
DefaultOrderPartOfMembersCloningStrategy
,PaymentOrderPartOfMembersCloningStrategy
public interface OrderPartOfMembersCloningStrategy
Defines a strategy for cloning the order's contract members. Regulates the rules whether:
need to be cloned for the given case. Allow to trigger cloning actions.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
addressNeedsCloning(AddressModel address, OrderModel order)
Checks according to business strategies whether given address needs to be cloned as a part of order's contract.AddressModel
cloneAddressForOrder(AddressModel address, OrderModel order)
Clones an address and sets the order as the clone's owner.PaymentInfoModel
clonePaymentInfoForOrder(PaymentInfoModel paymentInfo, OrderModel order)
Clones a payment info and sets the order as the clone's owner.boolean
paymentInfoNeedsCloning(PaymentInfoModel paymentInfo, OrderModel order)
Checks according to business strategies whether given payment info needs to be cloned as a part of order's contract.
-
-
-
Method Detail
-
cloneAddressForOrder
AddressModel cloneAddressForOrder(AddressModel address, OrderModel order)
Clones an address and sets the order as the clone's owner.- Parameters:
address
- address to cloneorder
- owning order- Returns:
- cloned but not persisted
AddressModel
instance.
-
addressNeedsCloning
boolean addressNeedsCloning(AddressModel address, OrderModel order)
Checks according to business strategies whether given address needs to be cloned as a part of order's contract.- Parameters:
address
-order
-- Returns:
- true if this address needs to be cloned.
- Throws:
java.lang.IllegalArgumentException
- if order is null
-
clonePaymentInfoForOrder
PaymentInfoModel clonePaymentInfoForOrder(PaymentInfoModel paymentInfo, OrderModel order)
Clones a payment info and sets the order as the clone's owner.- Parameters:
paymentInfo
- payment info to cloneorder
- owning order- Returns:
- cloned but not persisted
PaymentInfoModel
instance.
-
paymentInfoNeedsCloning
boolean paymentInfoNeedsCloning(PaymentInfoModel paymentInfo, OrderModel order)
Checks according to business strategies whether given payment info needs to be cloned as a part of order's contract.- Parameters:
paymentInfo
-order
-- Returns:
- true if this address needs to be cloned.
- Throws:
java.lang.IllegalArgumentException
- if order is null
-
-