title: Kotlin: common interface on Enum class with static method to map from String
body: <p>Suppose I have many enum classes like the following: </p>
  
  <pre class="lang-java prettyprint-override"><code>enum class Hero(val alias: String) {
      SUPERMAN("Clark Kent"),
      BATMAN("Bruce Wayne");
  
      companion object {
          fun fromAlias(value: String): Hero? = Hero.values().find { it.alias.equals(value, true) }
      }
  }
  
  enum class Villain(val alias: String) {
      TWO_FACE("Harvey Dent"),
      RIDDLER("Edward Nigma");
  
      companion object {
          fun fromAlias(value: String): Villain? = Villain.values().find { it.alias.equals(value, true) }
      }
  }
  </code></pre>
  
  <p>I'd like to be able to create a generic interface to handle the <code>fromAlias</code> method in such a way that I can still call it using <code>Hero.fromAlias("Bruce Wayne")</code>. So my enum classes would be simplified to something like:</p>
  
  <pre class="lang-java prettyprint-override"><code>enum class Hero(override val alias: String): AliasedEnum&lt;Hero&gt; {
      SUPERMAN("Clark Kent"),
      BATMAN("Bruce Wayne");
  }
  
  enum class Villain(override val alias: String): AliasedEnum&lt;Villain&gt; {
      TWO_FACE("Harvey Dent"),
      RIDDLER("Edward Nigma");
  }
  </code></pre>
  
  <p>I attempted to incorporate the answer from <a href="https://stackoverflow.com/questions/56126945/kotlin-define-interface-for-enum-class-values-method">Kotlin define interface for enum class values method</a>, but couldn't see a way to access the enum values() from the companion object in the interface. Is there a clean way to do what I am wanting?</p>