title: default value while serialize/deserialize json/object using GSON
body: <p>I am using GSON for serialize and deserialize JSON/JAva Object for one of my application. I am using serializeNulls as some of my value need to be send as null to web service while some I don't want to be NULL. So what I tried in my setter/getter for which I don't need null that I have check that value is null or not, if its null then set the "" blank for it. But still when I am deserializing my object to json using gson.toJson() method its giving me null value for those.</p>
  
  <pre><code>private String mID;
  
  public void setId(final String id) {
      if(id == null) {
          id = "";
      }
      mID = id;
  }
  
  public String getId() {
      if(mID == null) {
          mID = "";
      }
      return mID;
  }
  
  Gson gson = new GsonBuilder().serializeNulls().create();
  </code></pre>
  
  <p>Any idea how can i avoid null for some of the fields and set blank "" using setter/getter method or some other way.</p>