More Related Content
Similar to Play2+Scala事始め (11)
Play2+Scala事始め
- 2. 自己紹介
Abe Asami きの子 (フリーエンジニア)
http://nocono.net/
Twitter: @aa7th
使用言語:Java、C#、Scala
PHPはたしなむ程度
13年8月5日月曜日
- 29. 使用例
opt match {
case Some(x) => println(x)
case None => println(“値なし”)
}
NullPointerExceptionを回避できる
(余談)良く似たものに例外処理用のEitherがある
13年8月5日月曜日
- 34. Form
val entryForm = Form(
mapping (
"name" -> nonEmptyText
)
((name: String) => Entrant(name = name))
((entrant: Entrant) => Some(entrant.name))
)
フォームフィールド
構築関数
分解関数
13年8月5日月曜日
- 35. Form
val entryForm = Form(
mapping (
"name" -> nonEmptyText
)
(Entrant.apply)(Entrant.unapply)
)
13年8月5日月曜日