title: Can't convert object of type java.lang.Boolean to type
body: <p>I have a problem with an object namely when creating a list of objects it gets an error like in the title.</p>
  <p><strong>Kotlin code</strong></p>
  <pre><code> private fun readNotification() {
          val firebaseUser = FirebaseAuth.getInstance().currentUser
          val reference = FirebaseDatabase.getInstance().getReference(&quot;Notifications&quot;)
              .child(firebaseUser!!.uid)
          reference.addValueEventListener(object : ValueEventListener{
              override fun onDataChange(dataSnapshot: DataSnapshot) {
                  notificationList.clear()
                  for (snapshot : DataSnapshot in dataSnapshot.children){
                      val notification = snapshot.getValue(NotificationData::class.java)!!
                      notificationList.add(notification)
                  }
                  notificationList.reverse()
                  notificationAdapter.notifyDataSetChanged()
              }
  
              override fun onCancelled(error: DatabaseError) {
              }
          })
      }
  </code></pre>
  <p><strong>Object code</strong></p>
  <pre><code>class NotificationData(
      var userId: String = &quot;&quot;,
      var text: String = &quot;&quot;,
      var postId: String = &quot;&quot;,
      var isPost: Boolean = false
  ) {}
  </code></pre>
  <p><strong>Firebase structure</strong></p>
  <p><a href="https://i.stack.imgur.com/SyDnK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SyDnK.png" alt="Firebase structure" /></a></p>
  <p>I know the error is on this line because the object has a boolean variable</p>
  <pre><code>val notification = snapshot.getValue(NotificationData::class.java)!!
  </code></pre>
  <p>I just don't know much how to deal with it now</p>