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

unused_code.FindResults.scala Maven / Gradle / Ivy

There is a newer version: 0.4.1
Show newest version
package unused_code

import metaconfig.generic.Surface
import metaconfig.Conf
import metaconfig.ConfDecoder
import metaconfig.ConfEncoder
import metaconfig.Hocon
import java.nio.file.Files
import java.nio.file.Path

final case class FindResults(values: List[FindResult.Use])

object FindResults {
  private[this] val empty = FindResults(Nil)
  implicit val surface: Surface[FindResults] = metaconfig.generic.deriveSurface[FindResults]
  implicit val encoder: ConfEncoder[FindResults] = metaconfig.generic.deriveEncoder[FindResults]
  implicit val decoder: ConfDecoder[FindResults] = metaconfig.generic.deriveDecoder[FindResults](empty)

  def loadFromFile(file: Path): FindResults = {
    val str = new String(Files.readAllBytes(file), "UTF-8")
    Conf.parseString(str)(Hocon).get.as[FindResults].get
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy