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 theNumberwasBigDecimalorBigIntegerwill use DecimalQuantity, when theNumberwasDoublewill 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
numericmeasurement. - Throws:
NullPointerException- when value or unit were null
-