This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.signalpath.model | |
import scala.collection.mutable | |
class Forest[A]()(ordering: Ordering[A]) { | |
val tree = new mutable.LinkedHashMap[Option[A], mutable.ListBuffer[A]]() | |
def addNode(parent: Option[A], node: A): Unit = { | |
val children = tree.get(parent).map(_ += node).getOrElse(mutable.ListBuffer[A](node)) | |
tree.put(parent,children.sorted(ordering)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val elastic = injector.getInstance[ElasticClient]( | |
Key.get(classOf[ElasticClient], | |
Names.named("elastic")) | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// define your json views | |
object MyViews { | |
class ViewA {} | |
class ViewB {} | |
class ViewC {} | |
} | |
// configure your object mapper | |
val mapper = new ObjectMapper with ScalaObjectMapper | |
mapper.registerModule(DefaultScalaModule) |
NewerOlder