API

The Unit of Measurement API provides a set of Java language programming interfaces for handling units and quantities.
The interfaces provide a layer which separates client code, that would call the API,
from library code, which implements the API.

alt text

The specification contains Interfaces and abstract classes with methods for unit operations:
* Checking of unit compatibility
* Expression of a quantity in various units
* Arithmetic operations on units

The JSR is lead by Jean-Marie Dautelle (@dautelle), Werner Keil (@keilw) and Otavio Santana (@otaviojava).
You can access the API by adding the following Maven dependencies:

<dependency>
  <groupId>javax.measure</groupId>
  <artifactId>unit-api</artifactId>
  <version>2.2</version>
</dependency>
For JSR 363 use <version>1.0</version>.

Further versions can be found here.

Release artifacts are accessible from the following repositories:

  • Maven Central

Though it is possible to only reference the API from your application, you should also add an implementation like the Indriya reference implementation. On the other hand you may leave the API out if you already declare Indriya, especially using the JPMS (Jigsaw) since the implementation also declares Unit-API as a "transitive" dependency.