title: Reading data from Firebase returns an empty class
body: <p>I'm saving objects of this class in the Firebase:</p>
  
  <pre><code>public class Route {
      private String uniqueId;
      private long routeTime;
      private float distance;
      private List&lt;Double&gt; lat;
      private List&lt;Double&gt; lon;
  
      public Route(){}
  
      public Route (Route r){
          this.uniqueId = r.uniqueId;
          this.routeTime = r.routeTime;
          this.distance = r.distance;
          this.lat = r.lat;
          this.lon = r.lon;
      }
  
      public Route (String id ,long time, float distance, List&lt;Double&gt; lat,List&lt;Double&gt; lon){
          this.uniqueId=id;
          this.routeTime=time;
          this.distance=distance;
          this.lat=lat;
          this.lon=lon;
      }
  
      public String getUid(){
          return uniqueId;
      }
  
      public long getTime(){
          return routeTime;
      }
  
      public float getDist(){
          return distance;
      }
  
      public List&lt;Location&gt; getPoints(){
          List&lt;Location&gt; points = new ArrayList&lt;Location&gt;();
          for (int i=0 ;i &lt; this.lon.size() ;i++){
              Location temp = new Location("");
              temp.setLongitude(this.lon.get(i));
              temp.setLatitude(this.lat.get(i));
              points.add(temp);
          }
          return points;
      }
  
  }
  </code></pre>
  
  <p>This is an example of the database after the upload:
  <a href="https://i.stack.imgur.com/yaNmo.png" rel="nofollow noreferrer">https://i.stack.imgur.com/yaNmo.png</a></p>
  
  <p>Here is the path I used to save it the database:</p>
  
  <pre><code>Routes = FirebaseDatabase.getInstance().getReference("Routes");
  
  currUserRoutes = Routes.child(FirebaseAuth.getInstance().getCurrentUser().getUid());
  currRoute = currUserRoutes.push();
  routeUID = currRoute.getKey();
  Route temp = new Route(routeUID,(endDate.getTime()-startDate.getTime())/1000,distance,lat,lon);
          currRoute.setValue(temp); //currRoute is a database reference 
  </code></pre>
  
  <p>And here is how I'm trying to retrieve it:</p>
  
  <pre><code>DatabaseReference routeRef= FirebaseDatabase.getInstance().getReference().child("Routes").child(userID);
  Query a=routeRef.orderByChild("uid").equalTo(routeID);
  a.addListenerForSingleValueEvent(new ValueEventListener() {
      @Override
      public void onDataChange(DataSnapshot dataSnapshot) {
  
          for(DataSnapshot singleSnapshot : dataSnapshot.getChildren()){
               curr_route = singleSnapshot.getValue(Route.class);
          }
      }
  </code></pre>
  
  <p>When I'm debugging android studio shows the correct values when retrieving the data. what I mean is this: <a href="https://i.stack.imgur.com/JuGfn.png" rel="nofollow noreferrer">pressMe</a></p>
  
  <p>The green text contain the correct values that I expect but the values I get in curr_route are null as if he got through the default constructor <a href="https://i.stack.imgur.com/8wBCU.png" rel="nofollow noreferrer">like this</a>.</p>
  
  <p>Will appreciate your help.</p>