Null-safe implementation is preferred by using Option. The caller can support default value by using getOrElse: messages.get("hello").getOrElse("world")
Null-safe implementation is preferred by using Option. The caller can support default value by using getOrElse: messages.get("hello").getOrElse("world")
The return value can also be used with format: messages.get("hello %d").map(_.format(5))