I don't see the added value of using a Map[String,List[String]] for the email context.
I think this make the code harder to test and read. We are also forced to "extract" parameters from the context with this code:
context.get.toList
.filter(_._1 startsWith key.substring(0, splitIndex)) //get the keys that have the parameter key
.map(e=> e._1.substring(splitIndex+1)+":"+e._2.head)
I don't see the added value of using a
Map[String,List[String]]
for the email context. I think this make the code harder to test and read. We are also forced to "extract" parameters from the context with this code:A simple class with
var
should be simpler no ? Something like https://gist.github.com/kencoba/1874015#file-builder-scala-L25