Skip to content

mercur3/jrusty

Repository files navigation

jrusty

What if Java was more like Rust?

What this library provides

  • A Result class following the specification of Rust’s std::result::Result with 1 of the 2 possible types: Ok or Err.
  • Sane conversions from java.lang.String to byte, int, long without the need for:
try {
    /* assignment */ Integer.parseInt(someQuestionableStringWeGotAsInput);
}
catch (NumberFormatException ex) {
    // do something
}
  • null safety for everything in this library.

Usage

Maven

<dependencies>
	<dependency>
		<groupId>com.gitlab.mercur3</groupId>
		<artifactId>jrusty</artifactId>
        <!-- the version you want to use, but prefer the latest -->
		<version>XXX</version>
	</dependency>
</dependencies>

Gradle

dependencies {
    // the version you want to use, but prefer the latest
	implementation 'com.gitlab.mercur3:jrusty:XXX'
}