Java 的 List 与 Scala 的 Seq 相互转换
1. List 转 Seq:
List<String> tmpList = new ArrayList<>(); tmpList.add("abc"); Seq<String> tmpSeq = JavaConverters.asScalaIteratorConverter(tmpList.iterator()).asScala().toSeq();
2. Seq 转 List:
List<String> tmpList = scala.collection.JavaConversions.seqAsJavaList(tmpSeq);