title: How to pass different enums as argument?
body: <p>I have some enums, all different, and I want to create a function that can find or not if a string is one of enum variable name (not sure it's really understandable).</p>
  
  <pre><code>enum MYENUM {
    ONE,
    TWO;
  }
  
  enum MYENUM1 {
    RED,
    GREEN;
  }
  </code></pre>
  
  <p>I want to do this (this is just for the example, my enum are more complicated):</p>
  
  <pre><code>if(isInEnum(MYENUM, "one")) ...
  if(isInEnum(MYENUM1, "one")) ...
  </code></pre>
  
  <p><code>isinEnum</code> function (the code is bad, it's just for understanding):</p>
  
  <pre><code>boolean isinEnum(enum enumeration, String search) {
    for(enum en : enumeration.values()){
      if(en.name().equalsIgnoreCase(search)) return true;
    }
    return false;
  }
  </code></pre>
  
  <p>Is this kind of thing possible?</p>
  
  <p>I think not, according to what I can read on the web, but maybe someone has a solution to do this, instead of making one loop for each enum.</p>