title: New enum with array
body: <p>I need to save enum values (<code>MERIA</code> and <code>SMI</code> in this case) from a list of strings created by <code>split()</code>.</p>
  
  <p>Here is what I have:</p>
  
  <pre><code>public AccessLevel[] getAccess() {
      String Access = "MERIA : SMI";
      String[] split = Access.split(" : ");
      for (String Acces : split) {
          list.add(AccessLevel.valueOf(Acces));
      }
      return new AccessLevel[]{AccessLevel.MERIA,AccessLevel.NONE};
  }
  </code></pre>
  
  <p>I want something like this, with the enum parameters from the list saved into an array:</p>
  
  <pre><code> public AccessLevel[] getAccess() {
      String Access = "MERIA : SMI";
      String[] split = Access.split(" : ");
      for (String Acces : split) {
          list.add(AccessLevel.valueOf(Acces));
      } 
      return new AccessLevel[]{list};
  
  }
  </code></pre>