Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/poad/tuple4j
https://github.com/poad/tuple4j
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/poad/tuple4j
- Owner: poad
- License: apache-2.0
- Created: 2017-05-19T22:53:01.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-02-12T15:59:06.000Z (almost 3 years ago)
- Last Synced: 2023-07-28T22:08:20.599Z (over 1 year ago)
- Language: Java
- Size: 70.3 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Tuple for Java
==========[![Build Status](https://travis-ci.org/poad/tuple4j.svg?branch=master)](https://travis-ci.org/poad/tuple4j)
The tuple4j provides the tuple for Java.
## What is Tuple?
[Wikipedia](https://en.wikipedia.org/wiki/Tuple)## Usage
### When group of two values.
```$java
Pair pair = Pair.of(10, 20);Systemm.out.println(pair._1); // 10
Systemm.out.println(pair._2); // 20Pair> 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.
```$java
Triple 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.
- make it as immutable object
- refer to [Tuple of Scaa](https://github.com/poad/tuple4j/blob/master/src/test/scala/com/github/poad/functional/type/tuple/exammple/TupleExample.scala)### Use by Maven
```com.github.poad
tuple4j
0.0.2```
### Use by Gradle
```bazaar
compile 'com.github.poad:tuple4j:0.0.2'
```