Skip to content

poad/tuple4j

Repository files navigation

Tuple for Java

Build Status

The tuple4j provides the tuple for Java.

What is Tuple?

Wikipedia

Usage

When group of two values.

Pair<Intger, Intger> pair = Pair.of(10, 20);

Systemm.out.println(pair._1);   // 10
Systemm.out.println(pair._2);   // 20

Pair<String, List<Long>> pair2 = Pair.of("hoge", Arrays.asList(20L, 30L));

org.junit.Assert.Assert.assetEquals(pair2._1, "hoge"); // passed
org.junit.Assert.Assert.assetEquals(pair2._2, Arrays.asList(20L, 30L)); // passed

When group of three values.

Triple<Intger, Intger, String> triple = Triple.of(10, 20, "a");

Systemm.out.println(triple._1);   // 10
Systemm.out.println(triple._2);   // 20
Systemm.out.println(triple._3);   // "a"

Why do you not encapsulate a properties?

There are the following reasons for it.

Use by Maven

<dependency>
    <groupId>com.github.poad</groupId>
    <artifactId>tuple4j</artifactId>
    <version>0.0.2</version>
</dependency>

Use by Gradle

compile 'com.github.poad:tuple4j:0.0.2'

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published