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);

转自:http://www.cnblogs.com/pekkle/p/9367577.html

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);

转自:http://www.cnblogs.com/pekkle/p/9367577.html

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-15
  • 2022-01-12
  • 2022-02-05
  • 2022-12-23
  • 2022-12-23
  • 2021-12-28
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-02
  • 2021-12-23
  • 2021-09-14
  • 2022-12-23
  • 2021-12-10
相关资源
相似解决方案