I\'m calling a Scala method, from Java. And I need to make the conversion from Seq to List.
I can\'t modified the signature of the Scala method, so I can\'t used the
Since Scala 2.9, you shouldn't use implicits from JavaConversions
since they are deprecated and will soon be removed. Instead, to convert Seq
into java List
use convert
package like this (although it doesn't look very nice):
import scala.collection.convert.WrapAsJava$;
public class Test {
java.util.List convert(scala.collection.Seq seq) {
return WrapAsJava$.MODULE$.seqAsJavaList(seq);
}
}