Class ItemAttributeFlatRateFulfillmentCalculator
java.lang.Object
com.broadleafcommerce.fulfillment.service.dto.calculator.ItemAttributeFlatRateFulfillmentCalculator
- All Implemented Interfaces:
FulfillmentCalculator
public class ItemAttributeFlatRateFulfillmentCalculator
extends Object
implements FulfillmentCalculator
Calculator that calculates flat rates based on the attributes of the
FulfillmentPricingItem
-
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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
int
By default, DB configured calculators run between the code level calculators.getId()
Returns the id of this calculatorgetName()
Returns the name of this calculatorReturns the service level that this calculator is able to operate on.getType()
boolean
boolean
Indicates whether this calculator should be used.boolean
matchesCurrency
(javax.money.CurrencyUnit currency) Always return true.void
setCalculatorTypePriority
(int calculatorTypePriority) void
setEnabled
(boolean enabled) void
void
void
setPriority
(Integer priority) void
setServiceLevel
(String serviceLevel) void
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
getFulfillmentCalculatorConfig, hasCalculatorConfig, matchesAddress, matchesAnyFulfillmentTypes, matchesAnyInventoryTypes, matchesAnyOriginInfo, matchesFulfillmentType, matchesInventoryType, matchesOriginInfo
-
Field Details
-
type
-
-
Constructor Details
-
ItemAttributeFlatRateFulfillmentCalculator
public ItemAttributeFlatRateFulfillmentCalculator()
-
-
Method Details
-
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
-
matchesCurrency
public boolean matchesCurrency(javax.money.CurrencyUnit currency) Always return true. This calculator uses MonetaryAmounts passed in on the request and therefore will always match. Note, however, in processing if the flat rate amounts are in a different currency than the fulfillment request, they will be ignored.- Specified by:
matchesCurrency
in interfaceFulfillmentCalculator
- Parameters:
currency
-- Returns:
-
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
-
canHandle
- Specified by:
canHandle
in interfaceFulfillmentCalculator
-
getEstimatedMinDaysToFulfill
- Specified by:
getEstimatedMinDaysToFulfill
in interfaceFulfillmentCalculator
-
getEstimatedMaxDaysToFulfill
- Specified by:
getEstimatedMaxDaysToFulfill
in interfaceFulfillmentCalculator
-
getCalculatorTypePriority
public int getCalculatorTypePriority()Description copied from interface:FulfillmentCalculator
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.- Specified by:
getCalculatorTypePriority
in interfaceFulfillmentCalculator
- Returns:
- The priority of this fulfillment calculator type.
-
getPriority
- Specified by:
getPriority
in interfaceFulfillmentCalculator
-
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.
-
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.
-
isEnabled
public boolean isEnabled() -
getType
- Specified by:
getType
in interfaceFulfillmentCalculator
-
setCalculatorTypePriority
public void setCalculatorTypePriority(int calculatorTypePriority) - Specified by:
setCalculatorTypePriority
in interfaceFulfillmentCalculator
-
setPriority
-
setId
-
setName
-
setServiceLevel
-
setEnabled
public void setEnabled(boolean enabled) -
setType
-