Skip to content

Instantly share code, notes, and snippets.

View nutjane's full-sized avatar
🏠
Working from home

nut j. nutjane

🏠
Working from home
  • Google
  • Planet Earth
View GitHub Profile
@lauris
lauris / ccToMap.scala
Created August 9, 2014 10:12
Convert case class to map in Scala
def ccToMap(cc: AnyRef) =
(Map[String, Any]() /: cc.getClass.getDeclaredFields) {
(a, f) =>
f.setAccessible(true)
a + (f.getName -> f.get(cc))
}
// Usage
case class Column(name: String,