Option-izing Java getters
问题 When working with Java from Scala, we have to account for null. HttpServletRequest getters (getAttribute, getHeader, etc.) for example, all potentially return null. I know I can manually do a case/match or map operation on each call to an HttpServletRequest method, but that's a bit tedious. Also, method calls like request.getHeader("Accept-Encoding") are a mouthful. I came up with an enrichment to handle both issues: class Servlet_Request_Provides_NullSafe_Getters (r: HttpServletRequest) {