title: Json string java bean object
body: <p>Okay, it's been a year since i touched this code.</p>
  
  <p>I'm using Volley in android to parse the Rest API response. I was really happy with that since GSON made it really easy.</p>
  
  <p>I know this one </p>
  
  <pre><code> Gson gson = new Gson();
  
  User u=gson.fromJson(jsonstring, User.class);
  System.out.println("userName: "+u.getusername);  
  </code></pre>
  
  <p>But for some reason i find it difficult to make this class and parse.. So for every Bean map i had to pass the specific class and read.</p>
  
  <p>But on the other hand i made generic approach. Were the User.class replaced to all in one Object collection class like the below one.</p>
  
  <pre><code>public class Collection {
  
  private Object data;
  private CollectionError error;
  private int statusCode;
  private boolean booleanStatus;
  
  
  public Object getData() {
      return data;
  }
  
  public void setData(Object data) {
      this.data = data;
  }
  
  public CollectionError getError() {
      return error;
  }
  
  public void setError(CollectionError error) {
      this.error = error;
  }
  
  public int getStatusCode() {
      return statusCode;
  }
  
  public void setStatusCode(int statusCode) {
      this.statusCode = statusCode;
  }
  
  public boolean isBooleanStatus() {
      return booleanStatus;
  }
  
  public void setBooleanStatus(boolean booleanStatus) {
      this.booleanStatus = booleanStatus;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>So i pass this to </p>
  
  <pre><code>Collection collection = gson.fromJson(jsonstring, CollectionResponse.class);
  </code></pre>
  
  <p>CollcetionResponse is setter and getter class.</p>
  
  <p>So the above was working fine untill, i forget something that made this to work.</p>
  
  <p>When i debug the whole collection was null.</p>
  
  <p>How do i clear this mesh?</p>
  
  <p>Thanks,
  Puspharaj</p>