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