got me thinking, is there a design paradigm that will avoid conditionals all together and yet achieve the same thing? Using java and SQL if it makes any difference.
See, for example:
https://refactoring.guru/replace-conditional-with-polymorphi...
Note that this can be made to work for simple conditionals. It's probably not going to help if you have really complicated conditions, the kind where you need to break out your old discrete math book and draw a truth table and use DeMorgan's Law and all of those other "rules of inference" to work out what happens.
Note also that there are (practical) limits to this in general. Creating lots of classes and overridden methods just to get rid of some conditional logic has the potential to make things even more byzantine and confusing, not less. But done well, and in limited doses, it can be a viable strategy.
If those design paradigms don't work, we've actually had a bit of luck using BPMN and executing it via Drools. This is not "easy" per say but our processes and decision tree were not simple either.
Wishing there was a simpler and modern BPMN like language that supported CDI directly.
if case=1 then (...)
if case=2 then (...)
If you have a unique outcome for each case, you'll probably have to take the long way. Without knowing what your code looks like though, it's difficult.Feel free to fudge variable names, function names, etc.