title: Android Kotlin convert data class into enum class
body: <p>Here <code>Customer</code> and <code>BodyModel</code> are data classes. I need an inner function at <code>User</code>, <code>toCustomer()</code>, to convert <code>User class</code> into <code>Customer class</code>. I am stuck at changing <code>Boolean type</code> to <code>Customer.Type</code></p>
  
  <p>Customer Class</p>
  
  <pre><code>data class Customer(
      val id: String,
      val bodyModel: BodyModel?,
      val isDrinks : Type
  ){
  
  enum class Type(val type: String, val value: Boolean) {
          NO("No", false),
          YES("Yes", true)
      }
  }
  </code></pre>
  
  <p>BodyModel class</p>
  
  <pre><code>data class BodyModel(
      val height: Int?,
      val weight: Int?
  )
  </code></pre>
  
  <p>User class</p>
  
  <pre><code>data class User(
      val id: String,
      val height: Int?,
      val isDrinks: Boolean?
  ){
  
  @Ignore
  fun toCustomer() = Customer(
      id, 
      BodyModel(height?:-1, -1 ),
      Customer.Type(?????????)
  )
  </code></pre>