I am making http get requests using gson and volley. My idea was to have a method return an object containing serialised JSON.
public JsonObject getRequest(){
//Make call
//Parse Json into JsonObject
return JsonObject;
}
My problem is that I want the method work with different api calls returning different data. I have 3 classes designed to store 3 different calls and I want the method to return the correct type of object. Is there a method or design pattern that would help me in this scenario or should I approach it from a different angle?
Aucun commentaire:
Enregistrer un commentaire