Skip to content

Instantly share code, notes, and snippets.

@devth
Created December 9, 2015 17:49
Show Gist options
  • Save devth/beb46c791c4ca2ae7ea1 to your computer and use it in GitHub Desktop.
Save devth/beb46c791c4ca2ae7ea1 to your computer and use it in GitHub Desktop.
case class DissertationRow(
name: Option[String]=None,
birthYear: Option[Int]=None,
dissertation: Option[String]=None) extends Row {
def setValueForOrdinal[A](ord: Int, value: A): DissertationRow =
ord match {
case 0 => this.copy(name = Some(value.asInstanceOf[String]))
case 1 => this.copy(birthYear = Some(value.asInstanceOf[Int]))
case 2 => this.copy(dissertation = Some(value.asInstanceOf[String]))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment