I have interface:
public interface CartService extends RemoteService{
T execute(Action action);
}
Your interface specifies that implementing classes must define that method for all T extends ActionResponse
. You want to define them for specific actions, and responses - I think your interface needs to be
public interface CartService>
extends RemoteService {
public T execute(A action)
}
and then implementation would be
public class XX implements CartService {
//...
}
As written, you may not need to explicitly parametrize with an extension of Action
type - as long as you can deal with any kind of Action
that is parametrized by GetCartResponse
and don't rely on specifics of the GetCart
action. In which case, your interface should look something like:
public interface CartService extends RemoteService {
public T execute(Action action);
}
and implementation
public class XX implements CartService {
public GetCartResponse execute(Action action) {
//...
}
}