Java Rut implementation published in Maven Central
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
gradle/wrapper
src
.gitignore
.travis.yml
README.md
build.gradle
gradlew
gradlew.bat
settings.gradle

README.md

JRut travis-ci

A reasonable Rut implementation... in Java

What's a Rut anyway?

It's Chile's SSN.

Why make a library out of this?

  • It's format implicitly allows for a tiny validation.
  • An open source library, should, in time, provide a reasonable set of tests.
  • Low compatibility (Java 5).
  • No dependencies.

How to use it?

The usual:

<dependency>
   <groupId>cl.daplay</groupId>
   <artifactId>jrut</artifactId>
   <version>1.0.1</version>
</dependency>

or

compile "cl.daplay:jrut:1.0.1"

and then...

import cl.daplay.jrut.JRut;

// Handles multiple formats
final JRut a = new JRut("5252856-9");
final JRut b = new JRut("1.0.1-9");
final JRut c = new JRut("52528569");

// Throws IllegalArgumentException on invalid arguments
try {
    final JRut c = new JRut("5252856K");
} catch (IllegalArgumentException ex) {
    // ...
}

// Pretty print
final JRut a = new JRut("52528569");
// prints "5.252.856-9"
System.out.println(a);

Building

Just run

./gradlew build