Package javax.measure.test.quantity
Class TestQuantities
Object
TestQuantities
Singleton class for accessing
Quantity
instances.- Since:
- 1.0
- Author:
- werner, otaviojava
-
Method Summary
Modifier and TypeMethodDescriptiongetQuantity
(Number value, Unit<Q> unit) Returns the scalar measurement.
-
Method Details
-
getQuantity
Returns the scalar measurement. When theNumber
wasBigDecimal
orBigInteger
will use DecimalQuantity, when theNumber
wasDouble
will DoubleQuantity otherwise NumberQuantity. in the specified unit.- Type Parameters:
Q
- The type of the quantity.- Parameters:
value
- the measurement value.unit
- the measurement unit.- Returns:
- the corresponding
numeric
measurement. - Throws:
NullPointerException
- when value or unit were null
-