如何使用Quartet构造Quintet
每个元组都有 add() 和 addAtX() 方法来转换元组。
package cn.xnip;
import org.javatuples.Quartet;
import org.javatuples.Quintet;
public class TupleTester {
public static void main(String args[]){
Quartet<Integer, Integer, Integer, Integer> quartet = Quartet.with(5,6,7,8);
System.out.println(quartet);
Quintet<Integer, Integer, Integer, Integer, String> quintet = quartet.add("test");
Quintet<String, Integer, Integer, Integer, Integer> quintet1 = quartet.addAt0("test");
System.out.println(quintet);
System.out.println(quintet1);
}
}
输出结果为: