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

ai.salmonbrain.ruleofthumb.ConfigUtils.scala Maven / Gradle / Ivy

The newest version!
package ai.salmonbrain.ruleofthumb

import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory
import com.fasterxml.jackson.module.scala.DefaultScalaModule

import java.io.File

object ConfigUtils {
  private val factory = new YAMLFactory()
  private val mapper = new ObjectMapper(factory)
  mapper.registerModule(DefaultScalaModule)

  def readConfig(path: String): Config = {
    mapper.readValue(new File(path), classOf[Config])
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy