All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.twitter.mustache.TwitterObjectHandler.scala Maven / Gradle / Ivy

There is a newer version: 0.9.14
Show newest version
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