Package de.hybris.platform.order
Interface AbstractOrderEntryService<E extends AbstractOrderEntryModel>
- All Known Subinterfaces:
CartEntryService,OrderEntryService
- All Known Implementing Classes:
DefaultAbstractOrderEntryService,DefaultCartEntryService,DefaultOrderEntryService
public interface AbstractOrderEntryService<E extends AbstractOrderEntryModel>
Generic service that allows creation of order entries of particular type. Concrete implementation should be typed for
a particular subtype of
AbstractOrderEntryModel. I.e :
-
OrderEntryServiceshould implement the AbstractOrderEntryService forOrderEntryModel, - CartEntryService should implement the AbstractOrderEntryService for
CartEntryModel, - ... etc
The service allows managing taxes and discounts on abstract order entry level.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddAllDiscountValues(E entry, List<DiscountValue> discountValues) Adds a collection of discount values into given entry.voidaddAllTaxValues(E entry, List<TaxValue> taxValues) Adds a collection of tax values into given entry.voidaddDiscountValue(E entry, DiscountValue discountValue) Adds a new discount value to the given entry.voidaddTaxValue(E entry, TaxValue taxValue) Adds a new tax value into given entry.createEntry(AbstractOrderModel abstractOrder) Creates a new instance of order entry for a given abstract order instance.createEntry(ComposedTypeModel entryType, AbstractOrderModel abstractOrder) Creates a new instance of abstract order entry of the specific composed type for a given order instance.getGlobalDiscountValue(E entry, DiscountValue discountValue) Searches for complete discount value (with calculated applied value) object created using given discountValue.voidremoveDiscountValue(E entry, DiscountValue discountValue) Removes given discount value from the given entry.voidremoveTaxValue(E entry, TaxValue taxValue) Removes given tax value from the given entry.
-
Method Details
-
createEntry
Creates a new instance of order entry for a given abstract order instance. The entry type is chosen to best suit the order instance. New entry remains not persisted.- Parameters:
abstractOrder- target order- Returns:
- new order entry of the suitable runtime type.
- See Also:
-
createEntry
Creates a new instance of abstract order entry of the specific composed type for a given order instance. New entry remains not persisted.- Parameters:
abstractOrder- target orderentryType- create entry of this specific type- Returns:
- new abstract order entry of the specific runtime type.
-
addDiscountValue
Adds a new discount value to the given entry. Entry remains not persisted. By default, after save operation, the entry will be not calculated. User needs to recalculate order in order to notice the added discount in the total price.- Parameters:
discountValue- discount value to addentry- targetAbstractOrderEntryModel- Throws:
IllegalArgumentException- if eitherorderordiscountValueis null.- See Also:
-
addAllDiscountValues
Adds a collection of discount values into given entry. Entry remains not persisted and not calculated. User needs to recalculate order in order to notice the added discounts in the total price.- Parameters:
discountValues- discount values to addentry- targetAbstractOrderEntryModel- Throws:
IllegalArgumentException- if eitherorderordiscountValuesis null.- See Also:
-
removeDiscountValue
Removes given discount value from the given entry. Entry remains not persisted and not calculated. User needs to recalculate order in order to notice the removed discount in the total price.- Parameters:
discountValue- discount value to removeentry- targetAbstractOrderEntryModel- Throws:
IllegalArgumentException- if eitherorderordiscountValueis null.- See Also:
-
getGlobalDiscountValue
Searches for complete discount value (with calculated applied value) object created using given discountValue. Returns null when discount value for given parameter can not be found. -
addTaxValue
Adds a new tax value into given entry. Entry remains not persisted. By default, after save operation, the entry will be not calculated. User needs to recalculate entry in order to notice the added tax value in the orders total tax. After recalculation of the order, the newTaxValueshould be present in orders tax valuesAbstractOrderModel.TOTALTAXVALUES.- Parameters:
taxValue- tax value to addentry- targetAbstractOrderEntryModel- Throws:
IllegalArgumentException- if eitherorderortaxValueis null.- See Also:
-
addAllTaxValues
Adds a collection of tax values into given entry. Entry remains not persisted and not calculated. User needs to recalculate entry in order to notice the added tax values in the orders total tax. After recalculation of the order, the newTaxValues should be present in orders tax valuesAbstractOrderModel.TOTALTAXVALUES.- Parameters:
taxValues- tax values to addentry- targetAbstractOrderEntryModel- Throws:
IllegalArgumentException- if eitherorderortaxValuesis null.- See Also:
-
removeTaxValue
Removes given tax value from the given entry. Entry remains not persisted and not calculated. User needs to recalculate entry in order to see the difference in order's total tax. After recalculation of the order, the removedTaxValueshould be removed from orders tax valuesAbstractOrderModel.TOTALTAXVALUES.- Parameters:
taxValue- tax value to removeentry- targetAbstractOrderEntryModel- Throws:
IllegalArgumentException- if eitherorderortaxValueis null.- See Also:
-