Open
Description
Hello, I am not finding how to resolve a Quantity<?>
instance if I am starting with a Number
and a Unit<?>
instance, using only the javax.measure
API. The trouble here is that I don't know the Quantity
class at runtime, so I can't call javax.measure.spi.ServiceProvider.getQuantityFactory(Class<Q> quantity)
to get the appropriate QuantityFactory
on which I could call javax.measure.spi.QuantityFactory.create(Number value, Unit<Q> unit)
.
I don't know there is a very easy way using Indriya: tech.units.indriya.quantity.Quantities.getQuantity(Number value, Unit<Q> unit)
but I am trying to understand how to achieve the same thing with only the javax.measure
API. Could you point me in the right direction?