An extension module for Groovy that allows easy integration with Scala types.
APACHE-2.0 License
The aim of this Groovy Extension Module is to provide easy interoperability with Scala types.
Ensure that you have Bintray enabled as repository:
repositories {
jcenter()
}
Then simply add the following build dependency to your project:
compile 'com.wiredforcode:groovy-scala-extension-module:0.3'
It decorates all java.util.Collection
and java.util.AbstractMap
instances with handy convenience methods such as:
java.util.Collection.toScalaList()
yields a scala.collection.immutable.List
java.util.Collection.toScalaSet()
yields a scala.collection.immutable.Set
java.util.Collection.toScalaSeq()
yields a scala.collection.Seq
java.util.AbstractMap.toScalaMap
yields a scala.collection.mutable.Map
Decorates scala.concurrent.Future[T]
instances with:
result()
yields the wrapped T
with default timeout of 10 Secondsresult(length: Int)
yields the wrapped T
with timeout of length
Secondsresult(length: Int, unit: TimeUnit)
yields the wrapped T
with timeout of length
in unit
sready()
blocks until ready with default timeout of 10 Secondsready(length: Int)
blocks until ready with timeout of length
Secondsready(length: Int, unit: TimeUnit)
blocks until ready with timeout of length
in unit
sAs the need arises, more sugar will be added to this extension module. Pull requests are always welcome!