title: How to handle illegal argument exception on a string->enum conversion?
body: <p>Say I have this enum type:</p>
  
  <pre><code>public enum Type { VALUEA, VALUEB };
  </code></pre>
  
  <p>And want to switch from string to this enum, using valueOf(). 
  How to handle this case, making it return a default value?</p>
  
  <pre><code>Type.valueOf("NOTVALID");
  </code></pre>