title: Convert a Map to an Object in Kotlin
body: <p>Hello guys I have a simple question ,
  I have a Map full of element and I want to convert It in my Object , let me show you some code :</p>
  
  <p>Here is my Object : </p>
  
  <pre><code>class Bundle(map: Map&lt;String, Any&gt;) {
      var version: String?
      var app: String?
      var countries: ArrayList&lt;Any&gt;?
      var currency: ArrayList&lt;Any&gt;?
      var force: Boolean?
      var name: String?
      var service: ArrayList&lt;Any&gt;?
      var money: Int?
  
      init {
          version= null
          app= null
          countries= arrayListOf()
          currency= arrayListOf&lt;Any&gt;()
          force= true
          name = ""
          service= arrayListOf&lt;Any&gt;()
          money= 0
      }
  }
  </code></pre>
  
  <p>And there is the Map that i want to convert:</p>
  
  <pre><code>fun getBundle() {
  
      var db = FirebaseFirestore.getInstance()
      val docRef = db.collection("aa").document("bb")
  
      docRef.get().addOnCompleteListener { task -&gt;
          if (task.isSuccessful) {
              val document = task.result
              if (document.exists()) {
                  Log.d("Doc", "DocumentSnapshot data: " + document.data!!)
                // Here i want to take (document.data!!) and convert it to my Bundle class
  
              } else {
                  Log.d("NO doc", "No such document")
              }
          } else {
              Log.d("ERROR", "get failed with ", task.exception)
          }
      }
  }
  </code></pre>
  
  <p>Thank you !</p>