I have one abstract Class Client and 4 children Client1 Client2 …
each of this client line:
response = service.iszr(params);
where response and params depends on class
in Class1 this is
Client1ResponseType response
Client1params params
now I want to add to the abstract class method:
protected abstract void sendRequest(?? response, ?? params);
but I dont know what type should be
I try somethink like this:
protected abstract <I, O> void sendRequest(I input, O output);
and in children
@Override
protected <Client1ResponseType, Client1params> void sendRequest(Client1ResponseType input,
Client1params output) {
output = service.iszrRobCtiAifo(input);
}
but with no succes. There is compilation error. What I am doing wrong ?
In the declaration of your abstract class you need to add this:
where SOME_CLASS1 is a subtype of your fist argument and SOME_CLASS2 is a subtype of your second argument, both can be
Objectif you need.And your abstract method goes like this:
When you extend the class, you need to specify those types like this:
Please let me know if you got any problems.