title: How to set and get json from setter/getter class?
body: <p>this is my pojo class and i want make method add diary in my diary services class then how to get and set json in this method and any other way to get and set json from setter/getter class.</p>
  
  <pre><code>public class Dairy extends BaseEntity {
  
  public String dairyId;
  public String dairyType;
  public String productName;
  private List&lt;Dairy&gt; dataList;
  
  
  
  public List&lt;Dairy&gt; getDataList() {
      return dataList;
  }
  
  public void setDataList(List&lt;Dairy&gt; dataList) {
      this.dataList = dataList;
  }
  
  public String getDairyId() {
      return dairyId;
  }
  
  public void setDairyId(String dairyId) {
      this.dairyId = dairyId;
  }
  
  public String getDairyType() {
      return dairyType;
  }
  
  public void setDairyType(String dairyType) {
      this.dairyType = dairyType;
  }
  
  public String getProductName() {
      return productName;
  }
  
  public void setProductName(String productName) {
      this.productName = productName;
  }
  </code></pre>