java.lang.Object
com.broadleafcommerce.fulfillment.common.domain.Dimensions

public class Dimensions extends Object
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 Details

  • Method Details

    • setLength

      public void setLength(BigDecimal length)
      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

      public void setWidth(BigDecimal width)
      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

      public void setDepth(BigDecimal depth)
      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

      public void setUnitOfMeasure(String lengthUnitOfMeasure)
      The unit of measure for the length, width, and depth
      Parameters:
      lengthUnitOfMeasure - The unit of measure for the length, width, and depth
    • getLength

      public BigDecimal 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

      public BigDecimal 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

      public BigDecimal 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

      public String getUnitOfMeasure()
      The unit of measure for the length, width, and depth
      Returns:
      The unit of measure for the length, width, and depth