Hi I am working with java 8
. Below is the case:
I have an empty interface AsyncResponse
like below:
package com.personal.carrot.core.models;
public interface AsyncResponse {
}
And I have a model APIResponse
package com.personal.carrot.core.models;
import org.codehaus.jackson.annotate.JsonProperty;
public class APIResponse implements AsyncResponse {
@JsonProperty("numberOfFeatures")
public Long numberOfFeatures;
}
And finally I have a service using Retrofit2
to make my API response:
public interface APIRepository {
@POST("MYURL")
Call<APIResponse> resolveCounts(@Body HashMap<String, String> body);
}
Now when I call the APIRepository like below:
Call<AsyncResponse> request = repository.resolveCounts(payload);
I get an error:
java: incompatible types: retrofit2.Call (com.personal.carrot.core.models.APIResponse) cannot be converted to retrofit2.Call(com.personal.carrot.core.models.AsyncResponse)