Package com.skava.cart.factoryimpl
Class CartEntityFactoryImpl
java.lang.Object
com.skava.cart.factoryimpl.CartEntityFactoryExtendedImpl
com.skava.cart.factoryimpl.CartEntityFactoryImpl
- All Implemented Interfaces:
CartEntityFactory
@Component
public class CartEntityFactoryImpl
extends CartEntityFactoryExtendedImpl
implements CartEntityFactory
The Class CartEntityFactoryImpl is used to convert model from one to another
type.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe CartStrategyWiredServices.Fields inherited from class com.skava.cart.factoryimpl.CartEntityFactoryExtendedImpl
messageSource
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateCartEntity
(CartDomain cartDomain, CollectionDomain collection) Method createCartEntity This method is used to create a CartEntity based on CartDomain.createItemEntity
(ItemDomain itemDomain, long cartId) Method createCartEntity This method is used to create a ItemEntity based on ItemDomain.createLoyaltyDetailsEntities
(long cartId, List<LoyaltyDetailsDomain> loyaltyDetails) Gets the loyaltyDetails entity.createLoyaltyDetailsEntity
(long cartId, LoyaltyDetailsDomain loyaltyDetailsDO) Creates the loyalty details entity from loyalty domain.createOtherChargesEntities
(long cartId, List<OtherChargesDomain> otherCharges) Gets the payment entity.createOtherChargesEntity
(long cartId, OtherChargesDomain otherChargesDO) Creates a new OtherChargesEntity object.createPaymentEntities
(long cartId, List<PaymentDomain> payments) Gets the payment entity.createPaymentEntity
(long cartId, PaymentDomain paymentDO) Creates the payment entity from payment domain.createPromotionEntity
(long cartId, List<PromotionDomain> domainModel) Gets the promotion entity.void
getUpdateLoyaltyDetailsEntity
(LoyaltyDetailsEntity loyaltyDetailsEntity, LoyaltyDetailsDomain loyaltyDetails) Gets the updated loyalty entity by checking with existing loyalty details.static void
setAccountIdInCartDomain
(CartEntity cartEntity, CartDomain cartDomain) Method setAccountIdInCartDomain This method is used to update a accountId in the cart Entity.void
updateCartEntity
(CartEntity cartEntity, CartDomain cartDomain) Update cart.protected static void
updateCartOrderFields
(CartEntity cartEntity, CartDomain cartDomain) to update order fields in cart.protected void
updateItem
(ItemDomain itemDomain, ItemEntity itemEntity) Method updateItem This method is used to update a ItemEntity based on ItemDomain.void
updateItemEntity
(ItemDomain itemDomain, ItemEntity itemEntity, String locale) Method updateItemEntity This method is used to update a ItemEntity based on ItemDomain.Methods inherited from class com.skava.cart.factoryimpl.CartEntityFactoryExtendedImpl
createAddressEntity, createCartSubscriptionEntity, createCommunicationPreferenceEntity, createItemPropertyEntity, createItemPropertyEntity, createLoyaltyDetailsEntity, createShippingEntity, createSkuEntity, createSubscriptionEntity, saveLoyaltyDetails, updateAddress, updateAddressEntity, updateCartSubcription, updateCommunicationPreferenceEntity, updateItemPropertyEntity, updateShippingEntity, updateSkuEntity, updateSubscriptionEntity
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.skava.cart.factory.CartEntityFactory
createAddressEntity, createCartSubscriptionEntity, createCommunicationPreferenceEntity, createShippingEntity, updateAddressEntity, updateCartSubcription, updateCommunicationPreferenceEntity, updateShippingEntity
-
Field Details
-
cartStrategyWiredServices
The CartStrategyWiredServices.
-
-
Constructor Details
-
CartEntityFactoryImpl
public CartEntityFactoryImpl()
-
-
Method Details
-
createCartEntity
Method createCartEntity This method is used to create a CartEntity based on CartDomain.- Specified by:
createCartEntity
in interfaceCartEntityFactory
- Parameters:
cartDomain
- the cart domaincollection
- the collection- Returns:
- the instance of
CartEntity
. - See Also:
-
createItemEntity
Method createCartEntity This method is used to create a ItemEntity based on ItemDomain.- Specified by:
createItemEntity
in interfaceCartEntityFactory
- Parameters:
itemDomain
- the item domaincartId
- the cart identifier- Returns:
- the instance of
ItemEntity
. - See Also:
-
createPromotionEntity
Gets the promotion entity.- Specified by:
createPromotionEntity
in interfaceCartEntityFactory
- Parameters:
cartId
- the cart identifierdomainModel
- the domain model- Returns:
- the instance of List of
PromotionEntity
.
-
createPaymentEntities
Description copied from interface:CartEntityFactory
Gets the payment entity.- Specified by:
createPaymentEntities
in interfaceCartEntityFactory
- Parameters:
cartId
- The cart identifierpayments
- The cart payments- Returns:
- The list of payment entities
-
createLoyaltyDetailsEntities
public List<LoyaltyDetailsEntity> createLoyaltyDetailsEntities(long cartId, List<LoyaltyDetailsDomain> loyaltyDetails) Description copied from interface:CartEntityFactory
Gets the loyaltyDetails entity.- Specified by:
createLoyaltyDetailsEntities
in interfaceCartEntityFactory
- Parameters:
cartId
- The cart identifierloyaltyDetails
- The cart loyalty details- Returns:
- The list of loyalty details entities
-
createLoyaltyDetailsEntity
public LoyaltyDetailsEntity createLoyaltyDetailsEntity(long cartId, LoyaltyDetailsDomain loyaltyDetailsDO) Creates the loyalty details entity from loyalty domain.- Parameters:
cartId
- the cart identifierloyaltyDetailsDO
- the LoyaltyDetailsDomain- Returns:
- the loyalty details entity
-
createPaymentEntity
Creates the payment entity from payment domain.- Specified by:
createPaymentEntity
in interfaceCartEntityFactory
- Parameters:
cartId
- the cart identifierpaymentDO
- the payment DO- Returns:
- the payment entity
-
updateCartEntity
Update cart.- Specified by:
updateCartEntity
in interfaceCartEntityFactory
- Parameters:
cartDomain
- the cart domaincartEntity
- the cart entity
-
getUpdateLoyaltyDetailsEntity
public void getUpdateLoyaltyDetailsEntity(LoyaltyDetailsEntity loyaltyDetailsEntity, LoyaltyDetailsDomain loyaltyDetails) Gets the updated loyalty entity by checking with existing loyalty details.- Specified by:
getUpdateLoyaltyDetailsEntity
in interfaceCartEntityFactory
- Parameters:
loyaltyDetailsEntity
- the loyalty details entityloyaltyDetails
- the loyalty details domain
-
setAccountIdInCartDomain
Method setAccountIdInCartDomain This method is used to update a accountId in the cart Entity.- Parameters:
cartEntity
- the cart entitycartDomain
- the cart domain
-
updateCartOrderFields
to update order fields in cart.- Parameters:
cartEntity
- to update order fields in entity.cartDomain
- to get values to update in entity.
-
updateItemEntity
Method updateItemEntity This method is used to update a ItemEntity based on ItemDomain.- Specified by:
updateItemEntity
in interfaceCartEntityFactory
- Parameters:
itemDomain
- the item domainitemEntity
- the cart entitylocale
- to throw error based on given locale.- See Also:
-
updateItem
Method updateItem This method is used to update a ItemEntity based on ItemDomain.- Parameters:
itemDomain
- the item domainitemEntity
- the cart entity- See Also:
-
createOtherChargesEntity
Description copied from interface:CartEntityFactory
Creates a new OtherChargesEntity object.- Specified by:
createOtherChargesEntity
in interfaceCartEntityFactory
- Parameters:
cartId
- the cart identityotherChargesDO
- the otherCharges DO- Returns:
- the otherCharges entity
-
createOtherChargesEntities
public List<OtherChargesEntity> createOtherChargesEntities(long cartId, List<OtherChargesDomain> otherCharges) Description copied from interface:CartEntityFactory
Gets the payment entity.- Specified by:
createOtherChargesEntities
in interfaceCartEntityFactory
- Parameters:
cartId
- the cart identifierotherCharges
- the domain model- Returns:
- the otherCharges entity
-