I would like to hear other suggestions, but this is a solution that I found, and I could not find it anywhere on Google.
If my normal Scala entry point is a method that looks something like this:
def doSomething(things: List[Thing]): List[Result] = { ... }
I add another way:
//import scala.collection.JavaConversions._ import scala.collection.JavaConverters._ def doSomething(things: java.util.List[Thing]): java.util.List[Result] = doSomething(things.asScala.toList).asJava
The explicit transformation in invoking the original method is that it will be completed in an infinite loop that calls itself.
This is my first attempt to post and answer my own question ... apologize if I missed some standard way to do this. It seems to be worth sharing, and it is also worth opening a discussion about the best methods, as I am VERY new to Scala.
EDIT Updated code to reflect offer from @Luigi Plinge
ShatyUT
source share