Android Api call to items in list
<p>I am trying to make a call to each items in list to add some extra data for each item in list. I am using retrofit + RxJava. </p>

<p>I need to get list of user, for each user make a call and get City by his adreess postal code.</p>

<p>How I am trying to get this.</p>

<pre><code>public void getUsers() {
    Observable&lt;List&lt;User&gt;&gt; userObservable = mService.getUsers()
            .flatMapIterable(new Func1&lt;List&lt;User&gt;, Iterable&lt;User&gt;&gt;() {
                @Override
                public Iterable&lt;User&gt; call(List&lt;User&gt; user) {
                    return users;
                }
            })
            .flatMap(new Func1&lt;User, Observable&lt;City&gt;&gt;() {
                @Override
                public Observable&lt;City&gt; call(User user) {
                    return mService.getCity(user.getAdress.getPostal_code);
                }
            })
            .map(new Func1&lt;User, City&gt;() {
                @Override
                public City call(User user) {
                    return user.getAdress().getCity().getName();
                }
            })
</code></pre>

<p>service:</p>

<pre><code>@GET("/somelink/users")
Observable&lt;List&lt;User&gt;&gt; getUsers();

@GET("/somelink/users/{code}")
Observable&lt;City&gt; getCity(@Path("code") String postalCode);



public class User {

    @SerializedName("id")
    @Expose
    private Integer id;

    @SerializedName("name")
    @Expose
    private String name;

    @SerializedName("adress")
    @Expose
    private Adress adress;

    public Integer getId() {
        return id;
    }

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

    public String getName() {
        return name;
    }

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

    public Adress getAdress() {
        return adress;
    }

    public void setAdress(Adress adress) {
        this.adress = adress;
    }

}



public class Adress {

    privare City;

    @SerializedName("postal_code")
    @Expose
    private String postal_code;

    @SerializedName("street")
    @Expose
    private String street;

    public String getPostal_code() {
        return postal_code;
    }

    public void setPostal_code(String postal_code) {
        this.postal_code = postal_code;
    }

    public Adress getStreet() {
        return adress;
    }

    public void setStreet(String street) {
        this.street = street;
    }

    public City getCity() {
        return city;
    }

    public void setCity(City city) {
        this.city = city;
    }

}


public class City {

    @SerializedName("name")
    @Expose
    private String name;

    public String getName() {
        return name;
    }

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

}
</code></pre>

<p>getUsers() returns</p>

<pre><code>[
  {
    "id": 1
    "name": "John Doe",
    "adress": {
      "postal_code": "somecode",
      "street": "some Street ..."
    }
  },
  {
  "id": 2
  "name": "Adam Smith",
  "adress": {
    "postal_code": "somecode",
    "street": "some other Street ..."
  }
]
</code></pre>

<p>In map function I got error "no instance of type variable exists so that City conform to User". I think error is in Models, but dont know how to make them correct. I am a newbie to Rxjava and have problems here.</p>