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

public class Weight extends Object
Generally represents weight, including a value and unit of measure.
Author:
Kelly Tisdell (ktisdell)
  • Constructor Details

    • Weight

      public Weight(BigDecimal value, String unitOfMeasure)
    • Weight

      public Weight()
  • Method Details

    • of

      public static Weight of(BigDecimal value, String unit)
      Get a new Weight object from the given value and unit.
      Parameters:
      value - The value of the new Weight.
      unit - The unit of measure of the new Weight.
      Returns:
      A new Weight object from the given value and unit.
    • setValue

      public void setValue(BigDecimal value)
    • setUnitOfMeasure

      public void setUnitOfMeasure(String unitOfMeasure)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getValue

      public BigDecimal getValue()
      The numeric value of this weight.
      Returns:
      The numeric value of this weight.
    • getUnitOfMeasure

      public String getUnitOfMeasure()
      The unit of measure of this weight.
      Returns:
      The unit of measure of this weight.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object