In this application, I'm getting this error:
scala.Some cannot be cast to java.lang.String
When trying this:
x.email.asInstanceOf[String]
x.email is an Option[String]
Edit: I understand that I'm dealing with different types here, I was just wondering if there were a more concise way to do nothing with None then a
match { case....}
sequence. Because I am casting x.email into a String for JSON purposes, a null field will be handled by the JSON object, and I don't explicitly have to deal with it. Sorry for being unclear!!
foreach
method. – Missie