I have a class Transaction and a Service interface
public class Transaction {}
public interface RequestService {
public String getRequest(Transaction transaction);
}
Now I want to subclass the Transaction class and have a concrete class for the Service Interface
public class ESPTransaction extends Transaction {}
public class ESPRequestService implements RequestService {
@Override
public String getRequest(ESPTransaction espTransaction) {
StringBuffer buff = new StringBuffer(espTransaction.someMethodThatDoesntExistInParentClass());
return buff.toString();
}
}
The IDE complains that, even though ESPTransaction subclasses Transaction, that I am not overriding the supertype method.
How can I implement this?