title: Custom Object Retrieved from Firebase Always Has Null Attributes
body: <p>I'm trying to retreive a custom <code>User</code> object from Firebase as follows:</p>
  <pre><code>getUserFromDB(loggedInUserEmail);
  viewModel = new ViewModelProvider(this).get(UserViewModel.class);
  viewModel.sendUser(loggedInUser);
  
  //...
  
  public void getUserFromDB(String userEmail) {
      DocumentReference docRef = db.collection(&quot;users&quot;).document(userEmail);
      docRef.get().addOnSuccessListener(documentSnapshot -&gt; {
          loggedInUser = documentSnapshot.toObject(User.class);
  
          Log.d(&quot;User Login&quot;, documentSnapshot.getId() + &quot; =&gt; &quot; + documentSnapshot.getData());
          Toast.makeText(MainActivity.this, &quot;Login successful.&quot;, Toast.LENGTH_SHORT).show();
      });
  }
  </code></pre>
  <p>However, the user being retreived always has null attributes.
  <a href="https://i.stack.imgur.com/7iJm6.png" rel="nofollow noreferrer">Here's a screenshot</a> from when I was debugging.</p>
  <p>Note: I made sure my <code>User</code> class has a public empty constructor and all the attributes have a getter method.</p>