What's the best way in java to store data triple in a list ?
[a, b, c]
[a, b, c]
...
public class Triplet<T, U, V> {
private final T first;
private final U second;
private final V third;
public Triplet(T first, U second, V third) {
this.first = first;
this.second = second;
this.third = third;
}
public T getFirst() { return first; }
public U getSecond() { return second; }
public V getThird() { return third; }
}
And to instantiate the list:
List<Triplet<String, Integer, Integer>> = new ArrayList<>();