This library provides various helpful utilities for when working with Scala code.
Add the following to your build.sbt
file:
libraryDependencies += "tech.minna" %% "utilities" % "1.2.0"
resolvers += Resolver.bintrayRepo("minna-technologies", "maven")
This library is compiled for Scala 2.12.
Converts a field path to a string.
PathAsString.pathAsString[Family](_.mother.name.last) => "mother.name.last"
PathAsString.pathAsString((f: Family) => f.mother.name.last) => "mother.name.last"
// Options and collections can be unlifted by ~>
PathAsString.pathAsString[Family](_.father.~>.name.first) => "father.name.first"
PathAsString.pathAsString[Family](_.father.map(_.name).first) => "father.name.first"