title: Java convert a string to list of enums
body: <p>I have a string as follows:</p>
  
  <pre><code>"[Monday, Tuesday]"
  </code></pre>
  
  <p>I want to convert this string to a list of enums of type "Day". My "Day" enum is as follows:</p>
  
  <pre><code>public enum Day {
      Monday,Tuesday;
  }
  </code></pre>
  
  <p>I obtained my input string by calling toString() on a List of "Day"s. As follows:</p>
  
  <pre><code>List&lt;Day&gt; days = new ArrayList&lt;Day&gt;();
  days.add(Day.Monday);
  days.add(Day.Tuesday);
  
  String input = days.toString();
  </code></pre>
  
  <p>I know that I can parse the input string by commas and brackets. But, is there any efficient way to do this?</p>
  
  <p>To repeat, I want to covert string to a list of enums.</p>
  
  <p>** EDIT **</p>
  
  <p>Question is not just about converting String to enum and vice versa. It involves lists and string parsing.</p>