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
ConstructorDescriptionDBFulfillmentCalculator
(FulfillmentCalculatorConfig fulfillmentCalculatorConfig, GeoCoordinateService geoCoordinateService, WeightCalculationHelper weightCalculationHelper, DistanceCalculationHelper distanceCalculationHelper) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
addressIsWithinRadius
(FulfillmentDestinationDetail detail, com.broadleafcommerce.fulfillment.common.domain.Address address) boolean
protected com.broadleafcommerce.fulfillment.common.domain.Address
protected DistanceCalculationHelper
protected GeoCoordinateService
getId()
Returns the id of this calculatorgetName()
Returns the name of this calculatorReturns the service level that this calculator is able to operate on.protected WeightCalculationHelper
boolean
protected boolean
boolean
Indicates whether this calculator should be used.protected boolean
protected boolean
boolean
matchesAddress
(com.broadleafcommerce.fulfillment.common.domain.Address address) Returns true if this calculator can compute prices for the passed inAddress
boolean
matchesCurrency
(javax.money.CurrencyUnit currencyUnit) protected boolean
matchesDestination
(FulfillmentDestination destination, com.broadleafcommerce.fulfillment.common.domain.Address address) protected boolean
matchesDestinationDetail
(FulfillmentDestinationDetail detail, com.broadleafcommerce.fulfillment.common.domain.Address address) boolean
matchesFulfillmentType
(String type) Returns true if the calculator can handle the passed in fulfillment type.boolean
matchesInventoryType
(String type) Returns true if the calculator can handle the passed in inventory type.boolean
matchesOriginInfo
(com.broadleafcommerce.fulfillment.common.domain.FulfillmentOriginInfo originInfo) Returns true if theFulfillmentOriginInfo
can be handled by this calculator.void
setDistanceCalculationHelper
(DistanceCalculationHelper distanceCalculationHelper) void
setFulfillmentCalculatorConfig
(FulfillmentCalculatorConfig fulfillmentCalculatorConfig) void
setGeoCoordinateService
(GeoCoordinateService geoCoordinateService) void
setWeightCalculationHelper
(WeightCalculationHelper weightCalculationHelper) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
getPriority
in interfaceFulfillmentCalculator
-
getName
Description copied from interface:FulfillmentCalculator
Returns the name of this calculator- Specified by:
getName
in interfaceFulfillmentCalculator
- Returns:
- The name of the calculator which is useful for debugging.
-
getId
Description copied from interface:FulfillmentCalculator
Returns the id of this calculator- Specified by:
getId
in interfaceFulfillmentCalculator
- Returns:
- The id for this calculator which must be unique.
-
isEnabled
Description copied from interface:FulfillmentCalculator
Indicates 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:
isEnabled
in interfaceFulfillmentCalculator
- Returns:
- true if this calculator is enabled
-
getServiceLevel
Description copied from interface:FulfillmentCalculator
Returns the service level that this calculator is able to operate on.- Specified by:
getServiceLevel
in interfaceFulfillmentCalculator
- Returns:
- The service level
-
matchesCurrency
public boolean matchesCurrency(javax.money.CurrencyUnit currencyUnit) - Specified by:
matchesCurrency
in interfaceFulfillmentCalculator
-
matchesAddress
public boolean matchesAddress(com.broadleafcommerce.fulfillment.common.domain.Address address) Description copied from interface:FulfillmentCalculator
Returns true if this calculator can compute prices for the passed inAddress
- Specified by:
matchesAddress
in interfaceFulfillmentCalculator
- Returns:
- See Also:
-
canHandle
- Specified by:
canHandle
in interfaceFulfillmentCalculator
-
matchesOriginInfo
public boolean matchesOriginInfo(com.broadleafcommerce.fulfillment.common.domain.FulfillmentOriginInfo originInfo) Description copied from interface:FulfillmentCalculator
Returns true if theFulfillmentOriginInfo
can be handled by this calculator. The origin info is typically a container of inventory location references but can be implementation dependent.- Specified by:
matchesOriginInfo
in interfaceFulfillmentCalculator
- Returns:
-
matchesInventoryType
Description copied from interface:FulfillmentCalculator
Returns true if the calculator can handle the passed in inventory type.- Specified by:
matchesInventoryType
in interfaceFulfillmentCalculator
- Parameters:
type
- The type to check- Returns:
-
matchesFulfillmentType
Description copied from interface:FulfillmentCalculator
Returns true if the calculator can handle the passed in fulfillment type.- Specified by:
matchesFulfillmentType
in interfaceFulfillmentCalculator
- Parameters:
type
- The type to check- Returns:
-
getEstimatedMinDaysToFulfill
- Specified by:
getEstimatedMinDaysToFulfill
in interfaceFulfillmentCalculator
-
getEstimatedMaxDaysToFulfill
- Specified by:
getEstimatedMaxDaysToFulfill
in interfaceFulfillmentCalculator
-
hasCalculatorConfig
public boolean hasCalculatorConfig()- Specified by:
hasCalculatorConfig
in 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:
getFulfillmentCalculatorConfig
in interfaceFulfillmentCalculator
-
getGeoCoordinateService
-
getWeightCalculationHelper
-
getDistanceCalculationHelper
-