Skip to content

Commit

Permalink
enum.valueOf gone, replaced with Option(enum.withName)
Browse files Browse the repository at this point in the history
  • Loading branch information
indrajitr committed May 15, 2011
1 parent 261b17e commit 86081d9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ trait EnumTypedField[EnumType <: Enumeration] extends TypedField[EnumType#Value]
def asJStringName: JValue = valueBox.map(v => JString(v.toString)) openOr (JNothing: JValue)
def setFromJStringName(jvalue: JValue): Box[EnumType#Value] = jvalue match {
case JNothing|JNull if optional_? => setBox(Empty)
case JString(s) => setBox(enum.valueOf(s) ?~ ("Unknown value \"" + s + "\""))
case JString(s) => setBox(Option(enum.withName(s)) ?~ ("Unknown value \"" + s + "\""))
case other => setBox(FieldHelpers.expectedA("JString", other))
}

Expand Down

0 comments on commit 86081d9

Please sign in to comment.