title: How to prevent object to send null fields on API call for Retrofit2
body: <p>I am facing issue with retrofit object fields.
  e.g: I have object name <strong>criteria</strong> and it has <strong>20 fields</strong> no I want to send only first <strong>4 fields</strong> on API call and rest all should be ignore while api call.</p>
  
  <p>Below is my object:</p>
  
  <pre><code>public class Criteria {
  
  @SerializedName("mlsp_id")
  @Expose
  private String mlspId;
  @SerializedName("listing_key")
  @Expose
  private String listing_key;
  @SerializedName("limit")
  @Expose
  private String limit;
  @SerializedName("add_to_log")
  @Expose
  private Integer addToLog;
  @SerializedName("location")
  @Expose
  private String location;
  @SerializedName("property_type")
  @Expose
  private List&lt;String&gt; propertyType = null;
  @SerializedName("price")
  @Expose
  private Price price;
  @SerializedName("beds")
  @Expose
  private Beds beds;
  @SerializedName("baths")
  @Expose
  private Baths baths;
  @SerializedName("floor_area")
  @Expose
  private FloorArea floorArea;
  @SerializedName("lot_size")
  @Expose
  private LotSize lotSize;
  @SerializedName("year_built")
  @Expose
  private YearBuilt yearBuilt;
  @SerializedName("maintenance_fee")
  @Expose
  private MaintenanceFee maintenanceFee;
  @SerializedName("dom")
  @Expose
  private String dom;
  @SerializedName("keywords")
  @Expose
  private String keywords;
  @SerializedName("exclude")
  @Expose
  private List&lt;String&gt; exclude = null;
  @SerializedName("show_with")
  @Expose
  private List&lt;String&gt; showWith = null;
  @SerializedName("map_boundary")
  @Expose
  private List&lt;String&gt; mapBoundary = null;
  @SerializedName("sort_by")
  @Expose
  private String sortBy;
  @SerializedName("sch_level")
  @Expose
  private String schLevel;
  @SerializedName("sch_type")
  @Expose
  private String schType;
  @SerializedName("sch_rating")
  @Expose
  private Integer schRating;
  @SerializedName("listing_within_sch_radius")
  @Expose
  private Integer listingWithinSchRadius;
  @SerializedName("sch_id")
  @Expose
  private String schId;
  @SerializedName("sch_within_radius")
  @Expose
  private String schWithinRadius;
  @SerializedName("listing_within_skytrain_station_radius")
  @Expose
  private Integer listingWithinSkytrainStationRadius;
  @SerializedName("listing_within_skytrain_station_transit_minute")
  @Expose
  private Integer listingWithinSkytrainStationTransitMinute;
  @SerializedName("skytrain_station_id")
  @Expose
  private Integer skytrainStationId;
  @SerializedName("skytrain_station_within_radius")
  @Expose
  private Integer skytrainStationWithinRadius;
  
  public String getListing_key() {
      return listing_key;
  }
  
  public void setListing_key(String listing_key) {
      this.listing_key = listing_key;
  }
  
  public String getLimit() {
      return limit;
  }
  
  public void setLimit(String limit) {
      this.limit = limit;
  }
  
  public String getMlspId() {
      return mlspId;
  }
  
  public void setMlspId(String mlspId) {
      this.mlspId = mlspId;
  }
  
  public Integer getAddToLog() {
      return addToLog;
  }
  
  public void setAddToLog(Integer addToLog) {
      this.addToLog = addToLog;
  }
  
  public String getLocation() {
      return location;
  }
  
  public void setLocation(String location) {
      this.location = location;
  }
  
  public List&lt;String&gt; getPropertyType() {
      return propertyType;
  }
  
  public void setPropertyType(List&lt;String&gt; propertyType) {
      this.propertyType = propertyType;
  }
  
  public Price getPrice() {
      return price;
  }
  
  public void setPrice(Price price) {
      this.price = price;
  }
  
  public Beds getBeds() {
      return beds;
  }
  
  public void setBeds(Beds beds) {
      this.beds = beds;
  }
  
  public Baths getBaths() {
      return baths;
  }
  
  public void setBaths(Baths baths) {
      this.baths = baths;
  }
  
  public FloorArea getFloorArea() {
      return floorArea;
  }
  
  public void setFloorArea(FloorArea floorArea) {
      this.floorArea = floorArea;
  }
  
  public LotSize getLotSize() {
      return lotSize;
  }
  
  public void setLotSize(LotSize lotSize) {
      this.lotSize = lotSize;
  }
  
  public YearBuilt getYearBuilt() {
      return yearBuilt;
  }
  
  public void setYearBuilt(YearBuilt yearBuilt) {
      this.yearBuilt = yearBuilt;
  }
  
  public MaintenanceFee getMaintenanceFee() {
      return maintenanceFee;
  }
  
  public void setMaintenanceFee(MaintenanceFee maintenanceFee) {
      this.maintenanceFee = maintenanceFee;
  }
  
  public String getDom() {
      return dom;
  }
  
  public void setDom(String dom) {
      this.dom = dom;
  }
  
  public String getKeywords() {
      return keywords;
  }
  
  public void setKeywords(String keywords) {
      this.keywords = keywords;
  }
  
  public List&lt;String&gt; getExclude() {
      return exclude;
  }
  
  public void setExclude(List&lt;String&gt; exclude) {
      this.exclude = exclude;
  }
  
  public List&lt;String&gt; getShowWith() {
      return showWith;
  }
  
  public void setShowWith(List&lt;String&gt; showWith) {
      this.showWith = showWith;
  }
  
  public List&lt;String&gt; getMapBoundary() {
      return mapBoundary;
  }
  
  public void setMapBoundary(List&lt;String&gt; mapBoundary) {
      this.mapBoundary = mapBoundary;
  }
  
  public String getSortBy() {
      return sortBy;
  }
  
  public void setSortBy(String sortBy) {
      this.sortBy = sortBy;
  }
  
  public String getSchLevel() {
      return schLevel;
  }
  
  public void setSchLevel(String schLevel) {
      this.schLevel = schLevel;
  }
  
  public String getSchType() {
      return schType;
  }
  
  public void setSchType(String schType) {
      this.schType = schType;
  }
  
  public Integer getSchRating() {
      return schRating;
  }
  
  public void setSchRating(Integer schRating) {
      this.schRating = schRating;
  }
  
  public Integer getListingWithinSchRadius() {
      return listingWithinSchRadius;
  }
  
  public void setListingWithinSchRadius(Integer listingWithinSchRadius) {
      this.listingWithinSchRadius = listingWithinSchRadius;
  }
  
  public String getSchId() {
      return schId;
  }
  
  public void setSchId(String schId) {
      this.schId = schId;
  }
  
  public String getSchWithinRadius() {
      return schWithinRadius;
  }
  
  public void setSchWithinRadius(String schWithinRadius) {
      this.schWithinRadius = schWithinRadius;
  }
  
  public Integer getListingWithinSkytrainStationRadius() {
      return listingWithinSkytrainStationRadius;
  }
  
  public void setListingWithinSkytrainStationRadius(Integer listingWithinSkytrainStationRadius) {
      this.listingWithinSkytrainStationRadius = listingWithinSkytrainStationRadius;
  }
  
  public Integer getListingWithinSkytrainStationTransitMinute() {
      return listingWithinSkytrainStationTransitMinute;
  }
  
  public void setListingWithinSkytrainStationTransitMinute(Integer listingWithinSkytrainStationTransitMinute) {
      this.listingWithinSkytrainStationTransitMinute = listingWithinSkytrainStationTransitMinute;
  }
  
  public Integer getSkytrainStationId() {
      return skytrainStationId;
  }
  
  public void setSkytrainStationId(Integer skytrainStationId) {
      this.skytrainStationId = skytrainStationId;
  }
  
  public Integer getSkytrainStationWithinRadius() {
      return skytrainStationWithinRadius;
  }
  
  public void setSkytrainStationWithinRadius(Integer skytrainStationWithinRadius) {
      this.skytrainStationWithinRadius = skytrainStationWithinRadius;
  }
  
  }
  </code></pre>
  
  <p>Now lets while initializing object </p>
  
  <pre><code>Criteria.setPrice(1000.00);
  Criteria.setListingKey("Key20120");
  Criteria.setMlspId("Id2000");
  </code></pre>
  
  <p>So here total <strong>3 parameters</strong> will be utilized from <strong>Criteria</strong> object and rest all will be initialize as <strong>NULL</strong>.</p>
  
  <p>Now when I checked in Server logs it detect here Including initialized values rest all values are also appeared with <strong>blank value</strong></p>
  
  <p>So How can I prevent this <strong>blank values</strong> from Object 
  Is there any functionality like JSON Object where we can remove it.</p>