bio.ferlab.datalake.commons.config.package.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of datalake-commons_2.12 Show documentation
Show all versions of datalake-commons_2.12 Show documentation
Library built on top of Apache Spark to speed-up data lakes development..
package bio.ferlab.datalake.commons
import pureconfig.generic.semiauto.deriveEnumerationConvert
import pureconfig.generic.{EnumerationConfigReaderBuilder, EnumerationConfigWriterBuilder, ProductHint}
import pureconfig.{CamelCase, ConfigConvert, ConfigFieldMapping}
import shapeless.Lazy
package object config {
implicit def hint[T <: Configuration]: ProductHint[T] = ProductHint[T](ConfigFieldMapping(CamelCase, CamelCase))
val fieldMapping: ConfigFieldMapping = ConfigFieldMapping(CamelCase, CamelCase)
def enumConvert[T](implicit
readerBuilder: Lazy[EnumerationConfigReaderBuilder[T]],
writerBuilder: Lazy[EnumerationConfigWriterBuilder[T]]
): ConfigConvert[T] = deriveEnumerationConvert[T](fieldMapping)
}