Class MeasurementProperties
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionMap of a unit of measure to a list of aliases.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.
-
Constructor Details
-
MeasurementProperties
public MeasurementProperties()
-
-
Method Details
-
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
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
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
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.
-