In rest services how to dynamically avoid pojo class properties? That is, for example I have this POJO class
public ClassA{
private String a;
private String b;
private String c;
}
When I am returning my Json response from my main class, according to conditions, I want to ignore one value (but this ignore value is not always constant), it will differ. For example, sometime return combo is a,b and some other time b,c or a,c.
Currently it returns to me like below
"a" : "aa", "b": "bb", "c": null
But in the above set, I do not want to show "c" : null