The "When" class is rather useful to implement "if-then-else" bindings. We noticed that from time to time we write code to the following pattern...
When(x = v1).then(a).otherwise(when(x = v2).then(b).otherwise(c))
...which simply spoken is a "switch" binding.
Particularly for larger "switch" bindings it would be nice if this could be shortened to...
When(x = v1).then(a).otherwiseWhen(x = v2).then(b).otherwise(c)
...to reduce the level of parenthesis; or even simplified to...
Switch(x).case(v1, a).case(v2, b).default(c)
...which would be really unambiguous to read! :-)
When(x = v1).then(a).otherwise(when(x = v2).then(b).otherwise(c))
...which simply spoken is a "switch" binding.
Particularly for larger "switch" bindings it would be nice if this could be shortened to...
When(x = v1).then(a).otherwiseWhen(x = v2).then(b).otherwise(c)
...to reduce the level of parenthesis; or even simplified to...
Switch(x).case(v1, a).case(v2, b).default(c)
...which would be really unambiguous to read! :-)