Enum Class WeightUnit

java.lang.Object
java.lang.Enum<WeightUnit>
org.openwms.core.units.api.WeightUnit
All Implemented Interfaces:
Serializable, Comparable<WeightUnit>, Constable, BaseUnit<WeightUnit>

public enum WeightUnit extends Enum<WeightUnit> implements BaseUnit<WeightUnit>
A WeightUnit is a concrete set of all possible weights.

In SI format.

Author:
Heiko Scherrer
  • Enum Constant Details

  • Field Details

  • Constructor Details

    • WeightUnit

      private WeightUnit(BigDecimal magnitude)
      Create a new WeightUnit.
      Parameters:
      magnitude - The base unit of the WeightUnit
  • Method Details

    • values

      public static WeightUnit[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static WeightUnit valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getMagnitude

      public BigDecimal getMagnitude()
      Get the magnitude of this WeightUnit.
      Returns:
      the magnitude
    • getAll

      public List<WeightUnit> getAll()
      Return all sub types of the BaseUnit.
      Specified by:
      getAll in interface BaseUnit<WeightUnit>
      Returns:
      a list of sub types
    • getBaseUnit

      public WeightUnit getBaseUnit()
      Return the base unit type of the BaseUnit.
      Specified by:
      getBaseUnit in interface BaseUnit<WeightUnit>
      Returns:
      The base unit type