title: java enum receive values from string name
body: <p>I have enum like:</p>
  
  <pre><code>public enum Enum2 
  {
      ONE,TWO,THREE;
  }
  </code></pre>
  
  <p>I can list all values like:</p>
  
  <pre><code>public static void main(String... args)
  {
     for (Enum2 e : Enum2.values()) 
     {
          System.out.println(e);
     }
  
  }
  </code></pre>
  
  <p>Is it possible list values if I have only string name of Enum?</p>
  
  <pre><code>String enum_name="Enum2";
  </code></pre>
  
  <p>E.g. if in some logic like: </p>
  
  <pre><code>if (a&gt;b) 
  {
  enum_name="EnumA";
  } 
  else
  {
  enum_name="EnumB";
  }
  </code></pre>
  
  <p>And after I receive string name of enum - I can list all values.</p>