Class Dimensions
java.lang.Object
com.broadleafcommerce.fulfillment.common.domain.Dimensions
Represents 3 spatial dimensions - length, width, depth. These are typically the packaging or
shipping dimensions.
Passing null
to the setters will set the field to BigDecimal.ZERO
. Zero values
can be used to represent linear (one dimension, such as a length of rope) or area (two
dimensions, such as a square foot of fabric) measurements.
When creating FulfillmentPricingGroups
, CartOps
converts
Catalog Dimensions (com.broadleafcommerce.catalog.domain.product.Dimensions
) into objects
of this class (com.broadleafcommerce.fulfillment.common.domain.Dimensions
). The fields
are not named the same between the two classes, so this class's length
corresponds to
catalog dimension's height
.
-
Constructor Summary
ConstructorDescriptionDimensions
(BigDecimal length, BigDecimal width, BigDecimal depth, String unitOfMeasure) -
Method Summary
Modifier and TypeMethodDescriptiongetDepth()
Sets the depth of the item (1 of 3 dimensions).The length of the item (1 of 3 dimensions).The unit of measure for the length, width, and depthgetWidth()
The width of the item (1 of 3 dimensions).void
setDepth
(BigDecimal depth) Sets the depth of the item (1 of 3 dimensions).void
setLength
(BigDecimal length) Sets the length of the item (1 of 3 dimensions).void
setUnitOfMeasure
(String lengthUnitOfMeasure) The unit of measure for the length, width, and depthvoid
setWidth
(BigDecimal width) Sets the width of the item (1 of 3 dimensions).
-
Constructor Details
-
Dimensions
-
Dimensions
public Dimensions()
-
-
Method Details
-
setLength
Sets the length of the item (1 of 3 dimensions). The value must be greater than or equal to 0.- Parameters:
length
- The length of the item (1 of 3 dimensions).
-
setWidth
Sets the width of the item (1 of 3 dimensions). The value must be greater than or equal to 0.- Parameters:
width
- The width of the item (1 of 3 dimensions).
-
setDepth
Sets the depth of the item (1 of 3 dimensions). The value must be greater than or equal to 0. The reason that depth can be zero is that the depth of something might be ignored. Consider, for example, fabric or sheet metal that is sold by the square foot or square meter.- Parameters:
depth
- The depth of the item (1 of 3 dimensions).
-
setUnitOfMeasure
The unit of measure for the length, width, and depth- Parameters:
lengthUnitOfMeasure
- The unit of measure for the length, width, and depth
-
getLength
The length of the item (1 of 3 dimensions). The value must be greater than 0.- Returns:
- The length of the item (1 of 3 dimensions).
-
getWidth
The width of the item (1 of 3 dimensions). The value must be greater than or equal to 0.- Returns:
- The width of the item (1 of 3 dimensions).
-
getDepth
Sets the depth of the item (1 of 3 dimensions). The value must be greater than or equal to 0.- Returns:
- The depth of the item (1 of 3 dimensions).
-
getUnitOfMeasure
The unit of measure for the length, width, and depth- Returns:
- The unit of measure for the length, width, and depth
-