KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Suppose I have a method session.get(str: String): String but you don't know whether it will return you a string or a null, because it comes from Java. Is there an easier way to treat this in Scala instead of session.get("foo") == null ? Maybe some magic apply like ToOption(session.get("foo")) and then I can treat it in Scala way like ToOption(session.get("foo")) match { case Some(_) =>; case None =>; }
Tags (comma-separated)
Save Edits
Cancel