unitsofmeasurement / indriya

JSR 385 - Reference Implementation
Other
115 stars 40 forks source link

Names of derived units #367

Closed puigru closed 1 year ago

puigru commented 2 years ago

This is a revisit of #271. Many units are without their names because they're derived from others. This greatly reduces the usefulness of Unit#getName.

These all return null: Units.GRAM.getName() (expected: Gram) Units.METRE.prefix(MetricPrefix.KILO).getName() (expected: Kilometre) Units.CUBIC_METRE.getName() (expected: Cubic metre) ... and so on and so forth.

keilw commented 1 year ago

Except for Units.METRE.prefix(MetricPrefix.KILO).getName() (there's an operation involved and it therefore won't even either name or symbol) the other two can get a name inside the Units collection.

keilw commented 1 year ago

Now all units defined inside Units got a name.