I'm working with the following class and have trouble converting a scala long list to java.util.List[Long]:
import scala.collection.JavaConverters._
import org.apache.flink.streaming.connectors.twitter.TwitterSource
class myFilterEndpoint2 extends TwitterSource.EndpointInitializer with Serializable {
override def createEndpoint(): StreamingEndpoint = {
val customEndpoint2 = new StatusesFilterEndpoint()
customEndpoint2.followings(List[Long](545543434).asJava)
return customEndpoint2
}
}
I'm getting the error:
Type mismatch, expected: java.util.List[java.lang.Long], actual: java.util.List[Long]
How can I do the conversion properly?
List[java.lang.Long](545543434).asJava
would be the simplest way, I think. Too short for an answer :) – Vladimir Matveev