public final class Quantities extends Object
Quantity instances.| Modifier and Type | Method and Description |
|---|---|
static <Q extends javax.measure.Quantity<Q>> |
getQuantity(Number value,
javax.measure.Unit<Q> unit)
Returns the scalar measurement.
|
public static <Q extends javax.measure.Quantity<Q>> javax.measure.Quantity<Q> getQuantity(Number value, javax.measure.Unit<Q> unit)
Number was BigDecimal or BigInteger will uses DecimalQuantity, when the
Number was Double will DoubleQuantity otherwise will NumberQuantity. in the specified unit.value - the measurement value.unit - the measurement unit.numeric measurement.NullPointerException - when value or unit were nullCopyright © 2005–2024 Units of Measurement project. All rights reserved.