Class DBFulfillmentCalculator
java.lang.Object
com.broadleafcommerce.fulfillment.service.dto.calculator.DBFulfillmentCalculator
- All Implemented Interfaces:
FulfillmentCalculator
-
Field Summary
Fields inherited from interface com.broadleafcommerce.fulfillment.service.dto.calculator.FulfillmentCalculator
DEFAULT_CALCULATOR_TYPE_PRIORITY, DEFAULT_FLAT_RATE_TYPE_PRIORITY, FLAT_RATE_ITEM_ATTR, UNKNOWN -
Constructor Summary
ConstructorsConstructorDescriptionDBFulfillmentCalculator(FulfillmentCalculatorConfig fulfillmentCalculatorConfig, GeoCoordinateService geoCoordinateService, WeightCalculationHelper weightCalculationHelper, DistanceCalculationHelper distanceCalculationHelper) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanaddressIsWithinRadius(FulfillmentDestinationDetail detail, com.broadleafcommerce.fulfillment.common.domain.Address address) booleanprotected com.broadleafcommerce.fulfillment.common.domain.Addressprotected DistanceCalculationHelperprotected GeoCoordinateServicegetId()Returns the id of this calculatorgetName()Returns the name of this calculatorReturns the service level that this calculator is able to operate on.protected WeightCalculationHelperbooleanprotected booleanbooleanIndicates whether this calculator should be used.protected booleanprotected booleanbooleanmatchesAddress(com.broadleafcommerce.fulfillment.common.domain.Address address) Returns true if this calculator can compute prices for the passed inAddressbooleanmatchesCurrency(javax.money.CurrencyUnit currencyUnit) protected booleanmatchesDestination(FulfillmentDestination destination, com.broadleafcommerce.fulfillment.common.domain.Address address) protected booleanmatchesDestinationDetail(FulfillmentDestinationDetail detail, com.broadleafcommerce.fulfillment.common.domain.Address address) booleanmatchesFulfillmentType(String type) Returns true if the calculator can handle the passed in fulfillment type.booleanmatchesInventoryType(String type) Returns true if the calculator can handle the passed in inventory type.booleanmatchesOriginInfo(com.broadleafcommerce.fulfillment.common.domain.FulfillmentOriginInfo originInfo) Returns true if theFulfillmentOriginInfocan be handled by this calculator.voidsetDistanceCalculationHelper(DistanceCalculationHelper distanceCalculationHelper) voidsetFulfillmentCalculatorConfig(FulfillmentCalculatorConfig fulfillmentCalculatorConfig) voidsetGeoCoordinateService(GeoCoordinateService geoCoordinateService) voidsetWeightCalculationHelper(WeightCalculationHelper weightCalculationHelper) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.fulfillment.service.dto.calculator.FulfillmentCalculator
getCalculatorTypePriority, getType, matchesAnyFulfillmentTypes, matchesAnyInventoryTypes, matchesAnyOriginInfo, setCalculatorTypePriority
-
Constructor Details
-
DBFulfillmentCalculator
public DBFulfillmentCalculator() -
DBFulfillmentCalculator
public DBFulfillmentCalculator(FulfillmentCalculatorConfig fulfillmentCalculatorConfig, @Nullable GeoCoordinateService geoCoordinateService, WeightCalculationHelper weightCalculationHelper, DistanceCalculationHelper distanceCalculationHelper)
-
-
Method Details
-
getPriority
- Specified by:
getPriorityin interfaceFulfillmentCalculator
-
getName
Description copied from interface:FulfillmentCalculatorReturns the name of this calculator- Specified by:
getNamein interfaceFulfillmentCalculator- Returns:
- The name of the calculator which is useful for debugging.
-
getId
Description copied from interface:FulfillmentCalculatorReturns the id of this calculator- Specified by:
getIdin interfaceFulfillmentCalculator- Returns:
- The id for this calculator which must be unique.
-
isEnabled
Description copied from interface:FulfillmentCalculatorIndicates whether this calculator should be used. Database driven calculators will rely on active dates. Configured calculators can be disabled by setting this property.- Specified by:
isEnabledin interfaceFulfillmentCalculator- Returns:
- true if this calculator is enabled
-
getServiceLevel
Description copied from interface:FulfillmentCalculatorReturns the service level that this calculator is able to operate on.- Specified by:
getServiceLevelin interfaceFulfillmentCalculator- Returns:
- The service level
-
matchesCurrency
public boolean matchesCurrency(javax.money.CurrencyUnit currencyUnit) - Specified by:
matchesCurrencyin interfaceFulfillmentCalculator
-
matchesAddress
public boolean matchesAddress(com.broadleafcommerce.fulfillment.common.domain.Address address) Description copied from interface:FulfillmentCalculatorReturns true if this calculator can compute prices for the passed inAddress- Specified by:
matchesAddressin interfaceFulfillmentCalculator- Returns:
- See Also:
-
canHandle
- Specified by:
canHandlein interfaceFulfillmentCalculator
-
matchesOriginInfo
public boolean matchesOriginInfo(com.broadleafcommerce.fulfillment.common.domain.FulfillmentOriginInfo originInfo) Description copied from interface:FulfillmentCalculatorReturns true if theFulfillmentOriginInfocan be handled by this calculator. The origin info is typically a container of inventory location references but can be implementation dependent.- Specified by:
matchesOriginInfoin interfaceFulfillmentCalculator- Returns:
-
matchesInventoryType
Description copied from interface:FulfillmentCalculatorReturns true if the calculator can handle the passed in inventory type.- Specified by:
matchesInventoryTypein interfaceFulfillmentCalculator- Parameters:
type- The type to check- Returns:
-
matchesFulfillmentType
Description copied from interface:FulfillmentCalculatorReturns true if the calculator can handle the passed in fulfillment type.- Specified by:
matchesFulfillmentTypein interfaceFulfillmentCalculator- Parameters:
type- The type to check- Returns:
-
getEstimatedMinDaysToFulfill
- Specified by:
getEstimatedMinDaysToFulfillin interfaceFulfillmentCalculator
-
getEstimatedMaxDaysToFulfill
- Specified by:
getEstimatedMaxDaysToFulfillin interfaceFulfillmentCalculator
-
hasCalculatorConfig
public boolean hasCalculatorConfig()- Specified by:
hasCalculatorConfigin interfaceFulfillmentCalculator
-
matchesDestination
protected boolean matchesDestination(FulfillmentDestination destination, com.broadleafcommerce.fulfillment.common.domain.Address address) -
matchesDestinationDetail
protected boolean matchesDestinationDetail(FulfillmentDestinationDetail detail, com.broadleafcommerce.fulfillment.common.domain.Address address) -
addressIsWithinRadius
protected boolean addressIsWithinRadius(FulfillmentDestinationDetail detail, com.broadleafcommerce.fulfillment.common.domain.Address address) -
convertDetailToAddress
protected com.broadleafcommerce.fulfillment.common.domain.Address convertDetailToAddress(FulfillmentDestinationDetail detail) -
itemIsNotRestricted
-
isWeightRestricted
-
isDimensionRestricted
-
setFulfillmentCalculatorConfig
-
setGeoCoordinateService
-
setWeightCalculationHelper
-
setDistanceCalculationHelper
-
getFulfillmentCalculatorConfig
- Specified by:
getFulfillmentCalculatorConfigin interfaceFulfillmentCalculator
-
getGeoCoordinateService
-
getWeightCalculationHelper
-
getDistanceCalculationHelper
-