 <p>Depending on the number of conditional inputs, you might be able to use a look-up table, or even a <code>HashMap</code>, by encoding all inputs or even some relatively simple complex conditions in a single value:</p> <pre><code>int key = 0; key |= a?(1):0; key |= b?(1&lt;&lt;1):0; key |= (c.size() &gt; 1)?(1&lt;&lt;2):0; ... String result = table[key]; // Or result = map.get(key); </code></pre> <p>This paradigm has the added advantage of constant time (<code>O(1)</code>) complexity, which may be important in some occasions. Depending on the complexity of the conditions, you might even have fewer branches in the code-path on average, as opposed to full-blown <code>if-then-else</code> spaghetti code, which might lead to performance improvements.</p> <p>We might be able to help you more if you added more context to your question. Where are the condition inputs coming from? What are they like?</p> <p>And the more important question: <a href="http://mywiki.wooledge.org/XyProblem" rel="nofollow">What is the actual problem that you are trying to solve?</a></p>