Skip to content

Instantly share code, notes, and snippets.

@ilguzin
Created April 4, 2013 13:53
Show Gist options
  • Save ilguzin/5310536 to your computer and use it in GitHub Desktop.
Save ilguzin/5310536 to your computer and use it in GitHub Desktop.
Calling Scala code from Java with java.util.List when Scala's List is expected
// Implicit
import scala.collection.JavaConverters._
// For method:
def doSomething(things: List[Thing]): List[Result] = { ... }
// add the same method with another signature:
def doSomething(things: java.util.List[Thing]): java.util.List[Result] =
doSomething(things.asScala.toList).asJava
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment