### Build and Install JavaTuples with Maven
Source: https://github.com/arxila/javatuples/blob/main/BUILD.txt
Execute this command from the JavaTuples project root to build and install the project. This will create a JAR file and install it into your local Maven repository.
```bash
mvn clean:clean install
```
--------------------------------
### Tag Release and Prepare Next Development Version
Source: https://github.com/arxila/javatuples/blob/main/RELEASING.txt
Create a Git tag for the release and then update the project to the next development iteration (e.g., X.Y.[Z+1]-SNAPSHOT).
```shell
mvn scm:tag -Dtag=javatuples-X.Y.Z
mvn versions:set -DprocessAllModules=true -DnewVersion=X.Y.[Z+1]-SNAPSHOT
mvn versions:commit
git add .;
git commit -m "Prepare for next development iteration"
git push
```
--------------------------------
### Configure Maven Settings for Snapshots and Staging
Source: https://github.com/arxila/javatuples/blob/main/RELEASING.txt
Configure access to snapshot and staging servers in your Maven settings.xml file. Replace placeholder credentials with your actual token username and password.
```xml
central[TOKEN USERNAME FROM CENTRAL][TOKEN PASSWORD FROM CENTRAL]central-portal-snapshots[TOKEN USERNAME FROM CENTRAL][TOKEN PASSWORD FROM CENTRAL]
```
--------------------------------
### Deploy Release Artifacts
Source: https://github.com/arxila/javatuples/blob/main/RELEASING.txt
Compile and deploy the release artifacts to the staging repositories using the 'releases' profile.
```shell
mvn -P releases clean compile deploy
```
--------------------------------
### Generate Javadoc for JavaTuples
Source: https://github.com/arxila/javatuples/blob/main/BUILD.txt
Run this Maven command from the JavaTuples root folder to generate HTML Javadoc documentation for the project.
```bash
mvn javadoc:javadoc
```
--------------------------------
### Set and Commit New Version using Maven
Source: https://github.com/arxila/javatuples/blob/main/RELEASING.txt
Update all modules to a new release version (X.Y.Z) and commit the changes. This prepares the project for a release build.
```shell
mvn versions:set -DprocessAllModules=true -DnewVersion=X.Y.Z
mvn versions:commit
git add .
git commit -m "Prepare release javatuples-X.Y.Z"
git push
```
--------------------------------
### Generate GPG Signature for Distribution Zip
Source: https://github.com/arxila/javatuples/blob/main/RELEASING.txt
Generate a detached GPG signature (.asc) for the distribution zip file using your release key.
```shell
gpg -ab --default-key key_ID_for_releases@arxila.io javatuples-X.Y.Z-dist.zip
```
--------------------------------
### Grow and Shrink Tuples
Source: https://github.com/arxila/javatuples/blob/main/README.md
Create larger tuples by appending elements using `withValueN()` or smaller tuples by removing elements using `withoutValueX()`.
```java
var pair = Pair.of("Hello", 42); // Pair
var trio = pair.withValue2("!"); // Grow to Trio
var solo = pair.withoutValue1(); // Shrink to Solo
```
--------------------------------
### Creating Numbered Tuples with Constructors
Source: https://github.com/arxila/javatuples/blob/main/README.md
Instantiate numbered tuples like Tuple2 directly using their constructors. The types of the elements are inferred from the arguments.
```java
// Numbered tuples
var tuple2 = new Tuple2<>("Hello", 42); // tuple2 : Tuple2
```
--------------------------------
### Creating Numbered Tuples with Factory Methods
Source: https://github.com/arxila/javatuples/blob/main/README.md
Use static `of` factory methods for a concise way to create numbered tuples. This is an alternative to using constructors.
```java
// Numbered tuples
var tuple2 = Tuple2.of("Hello", 42); // tuple2 : Tuple2
```
--------------------------------
### Creating Named Tuples with Constructors
Source: https://github.com/arxila/javatuples/blob/main/README.md
Instantiate named tuples like Pair and Trio directly using their constructors. The types of the elements are inferred from the arguments.
```java
// Named tuples
var pair = new Pair<>("Hello", 42); // pair : Pair
var trio = new Trio<>("A", "B", "C"); // trio : Trio
```
--------------------------------
### Creating Named Tuples with Factory Methods
Source: https://github.com/arxila/javatuples/blob/main/README.md
Use static `of` factory methods for a concise way to create named tuples. This is an alternative to using constructors.
```java
// Named tuples
var pair = Pair.of("Hello", 42); // pair : Pair
var trio = Trio.of("A", "B", "C"); // trio : Trio
```
--------------------------------
### Maven Dependency for javatuples
Source: https://github.com/arxila/javatuples/blob/main/USAGE.txt
Add this dependency to your Maven project's pom.xml to include the javatuples library. Replace {version} with the desired version.
```xml
io.arxilajavatuples{version}compile
```
--------------------------------
### Access Tuple Values by Index
Source: https://github.com/arxila/javatuples/blob/main/README.md
Access individual tuple values using `valueN()` methods. The `values()` method returns all tuple elements as a List.
```java
// Direct access
String value0 = pair.value0();
Integer value1 = pair.value1();
Long value9 = decet.value9();
// All values as a list
var values = tuple.values(); // values: List