Console based command processing: Mapping string to enum in java
<p>For my java console application, I need to call a set of functions with user given arguments. My operations O1, O2, .. O5 are defined as an enum as </p>

<pre><code>enum Operations {O1, O2, O3, O4, O5};
</code></pre>

<p>I need to read user input args[0] and call function F1, F2,...F5. </p>

<p>For example user is going to give:</p>

<pre><code>&gt;java MyApp O1 5 6
</code></pre>

<p>For this I suppose I need to map sting (args[0]) to an  enum so that I can use switch select. How to do this?</p>
