#
ucumate
ucumate is a developer-friendly Java library for working with units of measure based on the UCUM standard. At its core, it provides validation, canonicalization, conversion, and printing support with automatic caching. Optional features enable persistent database storage, mole-to-mass conversions, and high-precision calculation of conversion factors for special units.
An online demo is also available.
This library requires Java 21 to run.
Currently, all dependencies are hosted on the maven central snapshot repository, you need to add it to your pom.xml
<repositories>
<repository>
<name>Central Portal Snapshots</name>
<id>central-portal-snapshots</id>
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
You will need the core implementation.
<dependency>
<groupId>io.github.fhnaumann</groupId>
<artifactId>ucumate-core</artifactId>
<version>1.0.3-SNAPSHOT</version>
</dependency>
If you used Ucum-java previously, you can use the drop-in replacement module.
<dependency>
<groupId>io.github.fhnaumann</groupId>
<artifactId>ucumate-ucumjava-bridge</artifactId>
<version>1.0.3-SNAPSHOT</version>
</dependency>
If you want error analysis with detailed messages on invalid input, use the error feedback module.
<dependency>
<groupId>io.github.fhnaumann</groupId>
<artifactId>ucumate-error-feedback</artifactId>
<version>1.0.3-SNAPSHOT</version>
</dependency>
If you need high precision (especially when special units are involved) then you should use the ucumate-core-exact-special-math module.
<dependency>
<groupId>io.github.fhnaumann</groupId>
<artifactId>ucumate-core-exact-special-math</artifactId>
<version>1.0.3-SNAPSHOT</version>
</dependency>
If you need data persistence across restarts you can use the ucumate-persistence module .
<dependency>
<groupId>io.github.fhnaumann</groupId>
<artifactId>ucumate-persistence</artifactId>
<version>1.0.3-SNAPSHOT</version>
</dependency>
If you work with mol and mass units a lot you can use the optional ucumate-mol module.
<dependency>
<groupId>io.github.fhnaumann</groupId>
<artifactId>ucumate-mol-support</artifactId>
<version>1.0.3-SNAPSHOT</version>
</dependency>