Q: @Expose(serialize = false) giving null value Currently, I have faced an issue with serialization class.
I have values from the server which I have able to serialization. There is no issue from the server response. But now I want to add new extra parameter which is not coming from the server. I want to add a default value to "N". But every time it gives me null value.
Here isLocal is my additional parameter which is not coming from the server. I want to set the default value to N but while I access it always give me null value
public class ImageData implements Serializable {

@SerializedName("id")
private String id;

@SerializedName("siteid")
private String siteid;

@SerializedName("visitorid")
private String visitorid;

@SerializedName("imageurl")
private String imageurl;

@Expose(serialize = false)
private String isLocal = "N";

public ImageData(){

}


public ImageData(String id, String siteid, String visitorid, String imageurl, String isLocal) {
    this.id = id;
    this.siteid = siteid;
    this.visitorid = visitorid;
    this.imageurl = imageurl;
    this.isLocal = isLocal;
}

public String getIsLocal() {
    return isLocal;
}

public void setIsLocal(String isLocal) {
    this.isLocal = isLocal;
}

public String getId() {
    return id;
}

public void setId(String id) {
    this.id = id;
}

public String getSiteid() {
    return siteid;
}

public void setSiteid(String siteid) {
    this.siteid = siteid;
}

public String getVisitorid() {
    return visitorid;
}

public void setVisitorid(String visitorid) {
    this.visitorid = visitorid;
}

public String getImageurl() {
    return imageurl;
}

public void setImageurl(String imageurl) {
    this.imageurl = imageurl;
}

