I want to put the result of a split, with the same order into a data model (case class). How to do this without using additional vals. What I mean is this:
Lets say I have a case calss:
case class Result(eachValue: String, ofValue: String, thisValue: String, couldValue: String, beValue: String, aValue: String, valueValue: String)
which silently ignores if there are too many dots in the string and fails with a MatchError if there aren’t enough (if you want both to throw a MatchError, just remove the _* part).
The problem is, that the compiler cannot guarantee the number of elements that will result from the call to split, while the case class requires a fixed amount of parameters.