package jrummikub.util;

/**
 * A pair of objects
 * 
 * @param <T1>
 *            Type of first component
 * @param <T2>
 *            Type of second component
 */
public class Pair<T1, T2> {
	private final T1 first;
	private final T2 second;

	/**
	 * Create a new pair from two values
	 * 
	 * @param first
	 *            the first pair component
	 * @param second
	 *            the second pair component
	 */
	public Pair(T1 first, T2 second) {
		this.first = first;
		this.second = second;
	}

	/**
	 * Extract the first component of a pair
	 * 
	 * @return the first pair component
	 */
	public T1 getFirst() {
		return first;
	}

	/**
	 * Extract the second component of a pair
	 * 
	 * @return the second pair component
	 */
	public T2 getSecond() {
		return second;
	}

}
