How to resolve a Quantity instance for a Number and Unit
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start with the javax.measure.spi.ServiceProvider and QuantityFactory entry points named in the issue, then compare them with Indriya's Quantities.getQuantity(Number, Unit) implementation. Determine whether the standard API supports this without a runtime Quantity class; document the answer and any required API change or limitation.
Written by the indexing model from the issue text.
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?
- Dominant language
- Java
- Stars
- 195
- Forks
- 41
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from unitsofmeasurement/unit-api
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
unitsofmeasurement/unit-api#261 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
unitsofmeasurement/unit-api#260 · 1 comment ·
-
deferred design
Difficulty 5/5 Over a week Newbie friendliness 30/100
unitsofmeasurement/unit-api#256 · 5 comments ·
-
deferred design enhancement jdk
Difficulty 5/5 Over a week Newbie friendliness 20/100
unitsofmeasurement/unit-api#215 ·
-
Classpath Discovery Opendeferred enhancement jdk ready task
Difficulty 5/5 Over a week Newbie friendliness 25/100
unitsofmeasurement/unit-api#90 · 1 comment ·
All issues in unitsofmeasurement/unit-api
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100