Package org.openwms.core.units.api
Enum Class WeightUnit
- All Implemented Interfaces:
Serializable
,Comparable<WeightUnit>
,Constable
,BaseUnit<WeightUnit>
A WeightUnit is a concrete set of all possible weights.
In SI format.
- Author:
- Heiko Scherrer
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAll()
Return all sub types of theBaseUnit
.Return the base unit type of theBaseUnit
.Get the magnitude of thisWeightUnit
.static WeightUnit
Returns the enum constant of this class with the specified name.static WeightUnit[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
MG
Milligram. -
G
Gram. -
KG
Kilogram. -
T
Tons.
-
-
Field Details
-
magnitude
-
all
-
-
Constructor Details
-
WeightUnit
Create a newWeightUnit
.- Parameters:
magnitude
- The base unit of the WeightUnit
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
getMagnitude
Get the magnitude of thisWeightUnit
.- Returns:
- the magnitude
-
getAll
Return all sub types of theBaseUnit
.- Specified by:
getAll
in interfaceBaseUnit<WeightUnit>
- Returns:
- a list of sub types
-
getBaseUnit
Return the base unit type of theBaseUnit
.- Specified by:
getBaseUnit
in interfaceBaseUnit<WeightUnit>
- Returns:
- The base unit type
-