Enum Class PieceUnit

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

public enum PieceUnit extends Enum<PieceUnit> implements BaseUnit<PieceUnit>
A PieceUnit.
Author:
Heiko Scherrer
  • Enum Constant Details

    • PC

      public static final PieceUnit PC
      A Piece.
    • DOZ

      public static final PieceUnit DOZ
      A Dozen.
  • Field Details

  • Constructor Details

    • PieceUnit

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

    • values

      public static PieceUnit[] 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 PieceUnit 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 PieceUnit.
      Returns:
      the magnitude
    • getAll

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

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