Skip to content
This repository has been archived by the owner on Dec 11, 2024. It is now read-only.

Latest commit

 

History

History
28 lines (19 loc) · 811 Bytes

README.md

File metadata and controls

28 lines (19 loc) · 811 Bytes

Minna Utilities

This library provides various helpful utilities for when working with Scala code.

Setup

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.

Documentation

PathAsString.pathAsString

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"