Gson - Read a value with two different keys
<p>In my Android project I have two types of response where both <strong>response are identical except two keys</strong>. </p>

<p>Response 1</p>

<pre><code>{"fullName":"William Sherlock Scott Holmes","address":"221B Baker Street, London, England, UK","downloads":642,"rating":3,"repos":["https://link1","https://link2","https://link3"]}
</code></pre>

<p>Response 2</p>

<pre><code>{"name":"Sherlock","city":"London","downloads":642,"rating":3,"repos":["https://link1","https://link2","https://link3"]}
</code></pre>

<p>If you see the responses only two key names are changing  <strong>fullName/name</strong> and <strong>address/city</strong> </p>

<p>I don't want to create one more pojo for other response. My question is: is it possible to use only one Pojo to read both responses?</p>

<pre><code>public class AccountInfo {
    private String name;
    private String city;
    //other objects

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }
    //other setters and getters
}
</code></pre>

<p>Any help will be appreciated... </p>