title: Parsing JsonObject into kotlin Data class
body: <p>I am fairly new to <code>Kotlin</code> and I am trying to parse the <code>JsonObject</code> that I get from my <code>HTTPRequest</code> into <code>data class</code>. But I cannot get the <code>Instance</code> from the <code>data</code> class.</p>
  
  <pre><code>val jsonObjectRequest = JsonObjectRequest(Request.Method.GET, url, null,
      Response.Listener { response -&gt;
          val text = "Response: %s".format(response.toString())
          print(text)
      },
      Response.ErrorListener { error -&gt;
          // TODO: Handle error
      }
  
  )
  
  @Throws(AuthFailureError::class)
  @Override
  fun getHeaders(): Map&lt;String, String&gt; {
      var params = HashMap&lt;String, String&gt;()
      if (params == null) params = HashMap()
      val basicAuth = "Basic " + Base64.encodeToString("username:password".toByteArray(), Base64.NO_WRAP);
      params["Authorization"] = basicAuth
      //..add other headers
      return params
  }
  
  TempJsonObject.instance?.addToRequestQueue(jsonObjectRequest)
  </code></pre>
  
  <p><strong>Data Class</strong></p>
  
  <pre><code>data class TempJsonObject(
      val content: List&lt;Content&gt;) {
  data class Content(
          val kioskId: Int,
          val location: Location,
          val stats: Stats,
          val settings: Settings,
          val modules: String,
          val visibility: String
  ) {
      data class Stats(
              val allLockers: Int,
              val emptyLockers: Int,
              val malfunctionLockers: Int,
              val forCustomer: Int,
              val forCourier: Int,
              val bySize: BySize,
              val incoming: Any
      ) {
          data class BySize(
                  val XXSMALL: Xxsmall,
                  val XSMALL: Xsmall,
                  val SMALL: Small,
                  val MEDIUM: Medium,
                  val LARGE: Large,
                  val XLARGE: Xlarge
          ) {
              data class Xxsmall(
                      val empty: Int,
                      val hasContent: Int
              )
          ...
  </code></pre>
  
  <p>Is the way I am trying to do it the right approach and what am I doing wrong?</p>