
collections.Pair Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Utilities Show documentation
Show all versions of Utilities Show documentation
Java Utilities library containing general use utilities
package collections;
/**
* A record that represents a pair of two values in different types.
*
* @param the type of the first value in the pair
* @param the type of the second value in the pair
*/
public record Pair(A alpha, B beta){
/**
* Creates a new Pair object with the provided elements.
*
* @param alpha the first element of the pair.
* @param beta the second element of the pair.
* @param the type of the first element.
* @param the type of the second element.
* @return a new Pair object containing the provided elements.
*/
public static Pair of(A alpha, B beta){
return new Pair<>(alpha, beta);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy