title: How to retrieve list from POJO class
body: <p>I am unable to fetch the data from Firestore to Android. I am using the POJO (Java object class) method to get the values. How to proceed for this?</p>
  
  <p><img src="https://i.stack.imgur.com/LXTun.png" alt="1"></p>
  
  <p>Pojo class :</p>
  
  <pre><code>public class Documents {
      String documentID;
      String documentName;
      String documentDate;
      String inspectorName;
      String marketLocation;
  
  public Documents() {
  
  }
  
  public Documents(String documentID, String documentName, String documentDate, String inspectorName, String marketLocation) {
      this.documentID = documentID;
      this.documentName = documentName;
      this.documentDate = documentDate;
      this.inspectorName = inspectorName;
      this.marketLocation = marketLocation;
  }
  
  public String getDocumentID() {
      return documentID;
  }
  
  public String getDocumentName() {
      return documentName;
  }
  
  public String getDocumentDate() {
      return documentDate;
  }
  
  public String getInspectorName() {
      return inspectorName;
  }
  
  public String getMarketLocation() {
      return marketLocation;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>MainActivity.java :</p>
  
  <pre><code>List&lt;Documents&gt; documentsList = new ArrayList&lt;&gt;();
  
  Documents documents = documentsList.get(); // Error to retrieve all data
  
  primaryLayout(documents.getDocumentID(), documents.getDocumentName(), documents.getDocumentDate(), documents.getInspectorName(), documents.getMarketLocation());
  </code></pre>