Class MeasurementProperties
- java.lang.Object
-
- com.broadleafcommerce.shipping.service.autoconfigure.MeasurementProperties
-
@ConfigurationProperties("broadleaf.shipping.service.measurements") public class MeasurementProperties extends Object
-
-
Constructor Summary
Constructors Constructor Description MeasurementProperties()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,List<String>>
getUnitAliases()
Map of a unit of measure to a list of aliases.Integer
getWeightPrecision()
The number of significant digits to use for weight calculations.void
setUnitAliases(Map<String,List<String>> unitAliases)
Map of a unit of measure to a list of aliases.void
setWeightPrecision(Integer weightPrecision)
The number of significant digits to use for weight calculations.
-
-
-
Method Detail
-
getUnitAliases
public Map<String,List<String>> getUnitAliases()
Map of a unit of measure to a list of aliases. The aliases should align with the weight units enabled in the admin.
This is important when calculating the total package weight. By default,
UnitFormat.parse(CharSequence)
would findUSCustomary.POUND
from the String "lb", but not from "POUNDS". If an items weight is set in pounds in the admin, then the weight calculation would not be able to determine the unit for that value. Assigning aliases allows us to look up the unit of measure based on the admin data.This yaml property example would add "POUND" and "POUNDS" as aliases for
USCustomary.POUND
.broadleaf: shipping: service: measurements: unitAliases: systems.uom.common.USCustomary.POUND: - POUND - POUNDS
-
getWeightPrecision
public Integer getWeightPrecision()
The number of significant digits to use for weight calculations. This applies to all digits of a number, before and after the decimal. This is important when units are converted during weight calculations.
-
setUnitAliases
public void setUnitAliases(Map<String,List<String>> unitAliases)
Map of a unit of measure to a list of aliases. The aliases should align with the weight units enabled in the admin.
This is important when calculating the total package weight. By default,
UnitFormat.parse(CharSequence)
would findUSCustomary.POUND
from the String "lb", but not from "POUNDS". If an items weight is set in pounds in the admin, then the weight calculation would not be able to determine the unit for that value. Assigning aliases allows us to look up the unit of measure based on the admin data.This yaml property example would add "POUND" and "POUNDS" as aliases for
USCustomary.POUND
.broadleaf: shipping: service: measurements: unitAliases: systems.uom.common.USCustomary.POUND: - POUND - POUNDS
-
setWeightPrecision
public void setWeightPrecision(Integer weightPrecision)
The number of significant digits to use for weight calculations. This applies to all digits of a number, before and after the decimal. This is important when units are converted during weight calculations.
-
-