com.twitter.mustache.TwitterObjectHandler.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of compiler Show documentation
Show all versions of compiler Show documentation
Implementation of mustache.js for Java
package com.twitter.mustache
import com.twitter.util.Future
import java.util.concurrent.Callable
class TwitterObjectHandler extends ScalaObjectHandler {
override def coerce(value: Object) = {
value match {
case f: Future[_] => {
new Callable[Any]() {
def call() = {
val value = f.get().asInstanceOf[Object]
coerce(value)
}
}
}
case _ => super.coerce(value)
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy