title: How do I access a enum instance using its property in Kotlin?
body: <p>I have a enum class like this:</p>
  
  <pre><code>enum class ParkingLotStatus (val number:Int, var occupied: Boolean) {
          LOT1(1,true),
          LOT2(2,false)
      }
  </code></pre>
  
  <p>I want to select the enum instance using the <code>number</code> variable. If I get user input as <code>1</code>, I want to be able to pick the enum intense <code>LOT1</code> based on the variable (constant?) <code>number</code>.</p>
  
  <p>One way would be to iterate over all the enum instances and check if the input matches the variable</p>
  
  <p>Is there a more simple and not resource intense way to do this?</p>