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.
Length must be greater than 0. However, width and depth can both be zero to represent linear (one
dimension, such as a length of rope) or area (two dimensions, such as a square foot of fabric).
But usually things will be considered in 3 dimensions, especially for the purpose of fulfillment
because physical items actually are 3 dimensional, and most things will ship in a box or
packaging.
- Author:
- Kelly Tisdell (ktisdell)
-
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 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. An item's width might be 0 be when selling by linear feet or meters, e.g. rope by the foot.- 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. 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.- 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
-