Interface FulfillmentCalculator
- All Known Implementing Classes:
DBFulfillmentCalculator
,ItemAttributeFlatRateFulfillmentCalculator
public interface FulfillmentCalculator
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
default int
By default, DB configured calculators run between the code level calculators.default FulfillmentCalculatorConfig
getId()
Returns the id of this calculatorgetName()
Returns the name of this calculatordefault Integer
Returns the service level that this calculator is able to operate on.default String
getType()
default boolean
boolean
Indicates whether this calculator should be used.default boolean
matchesAddress
(com.broadleafcommerce.fulfillment.common.domain.Address address) Returns true if this calculator can compute prices for the passed inAddress
default boolean
matchesAnyFulfillmentTypes
(Collection<String> fulfillmentTypes) Loops through fulfillment types and callsmatchesFulfillmentType(String)
returning true if any matches.default boolean
matchesAnyInventoryTypes
(Collection<String> inventoryTypes) Loops through fulfillment types and callsmatchesInventoryType(String)
returning true if any matches.default boolean
matchesAnyOriginInfo
(Collection<com.broadleafcommerce.fulfillment.common.domain.FulfillmentOriginInfo> originInfos) Loops throughFulfillment Origin Infos
and callsmatchesOriginInfo(FulfillmentOriginInfo)
returning true if any matches.boolean
matchesCurrency
(javax.money.CurrencyUnit currency) default boolean
matchesFulfillmentType
(String type) Returns true if the calculator can handle the passed in fulfillment type.default boolean
matchesInventoryType
(String type) Returns true if the calculator can handle the passed in inventory type.default boolean
matchesOriginInfo
(com.broadleafcommerce.fulfillment.common.domain.FulfillmentOriginInfo originInfo) Returns true if theFulfillmentOriginInfo
can be handled by this calculator.default void
setCalculatorTypePriority
(int calculatorTypePriority)
-
Field Details
-
DEFAULT_FLAT_RATE_TYPE_PRIORITY
static final int DEFAULT_FLAT_RATE_TYPE_PRIORITY- See Also:
-
DEFAULT_CALCULATOR_TYPE_PRIORITY
static final int DEFAULT_CALCULATOR_TYPE_PRIORITY- See Also:
-
FLAT_RATE_ITEM_ATTR
- See Also:
-
UNKNOWN
- See Also:
-
-
Method Details
-
getId
String getId()Returns the id of this calculator- Returns:
- The id for this calculator which must be unique.
-
getName
String getName()Returns the name of this calculator- Returns:
- The name of the calculator which is useful for debugging.
-
getServiceLevel
String getServiceLevel()Returns the service level that this calculator is able to operate on.- Returns:
- The service level
-
isEnabled
Indicates whether this calculator should be used. Database driven calculators will rely on active dates. Configured calculators can be disabled by setting this property.- Returns:
- true if this calculator is enabled
-
hasCalculatorConfig
default boolean hasCalculatorConfig() -
getCalculatorTypePriority
default int getCalculatorTypePriority()By default, DB configured calculators run between the code level calculators. Implementations can control ordering by configuring calculators to run at the same "type" priority and then use only the "priority" field for default sorting.- Returns:
- The priority of this fulfillment calculator type.
-
setCalculatorTypePriority
default void setCalculatorTypePriority(int calculatorTypePriority) -
getPriority
-
matchesCurrency
boolean matchesCurrency(javax.money.CurrencyUnit currency) -
matchesAddress
default boolean matchesAddress(com.broadleafcommerce.fulfillment.common.domain.Address address) Returns true if this calculator can compute prices for the passed inAddress
- Parameters:
address
-- Returns:
- See Also:
-
canHandle
-
getFulfillmentCalculatorConfig
-
getType
-
matchesAnyOriginInfo
default boolean matchesAnyOriginInfo(Collection<com.broadleafcommerce.fulfillment.common.domain.FulfillmentOriginInfo> originInfos) Loops throughFulfillment Origin Infos
and callsmatchesOriginInfo(FulfillmentOriginInfo)
returning true if any matches.- Parameters:
addressList
-- Returns:
- true if any of the passed in origin structures can be handled by this calculator
- See Also:
-
matchesAnyFulfillmentTypes
Loops through fulfillment types and callsmatchesFulfillmentType(String)
returning true if any matches.- Parameters:
fulfillmentTypes
- The list of fulfillment types- Returns:
- true if any of the passed in fulfillment types can be handled by this calculator
- See Also:
-
matchesAnyInventoryTypes
Loops through fulfillment types and callsmatchesInventoryType(String)
returning true if any matches.- Parameters:
inventoryTypes
- The list of inventory types- Returns:
- true if any of the passed in inventory types can be handled by this calculator
- See Also:
-
matchesOriginInfo
default boolean matchesOriginInfo(com.broadleafcommerce.fulfillment.common.domain.FulfillmentOriginInfo originInfo) 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.- Parameters:
originInfo
-- Returns:
-
matchesFulfillmentType
Returns true if the calculator can handle the passed in fulfillment type.- Parameters:
type
- The type to check- Returns:
-
matchesInventoryType
Returns true if the calculator can handle the passed in inventory type.- Parameters:
type
- The type to check- Returns:
-
getEstimatedMinDaysToFulfill
Integer getEstimatedMinDaysToFulfill() -
getEstimatedMaxDaysToFulfill
Integer getEstimatedMaxDaysToFulfill()
-