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

public class Distance extends Object
Represents a distance with a value and unit of measure.
  • Constructor Details

    • Distance

      public Distance(BigDecimal value, String unitOfMeasure)
    • Distance

      public Distance()
  • Method Details

    • of

      public static Distance of(BigDecimal value, String unit)
      Get a new Distance object from the given value and unit.
      Parameters:
      value - The value of the new Distance.
      unit - The unit of measure of the new Distance
      Returns:
      A new Distance 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 distance.
      Returns:
      The numeric value of this distance.
    • getUnitOfMeasure

      public String getUnitOfMeasure()
      The unit of measure of this distance.
      Returns:
      The unit of measure of this distance.
    • 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