I am creating a class that overrides the signature of the method, erasing which is identical between the two implemented interfaces, but with a slight difference in relation to the general type (one is the type defined by the method, the other type is inferred-class type), I am looking for a neat solution. I CAN ONLY edit the inherited class, and not the original deprecated interfaces.
To show this case, I compiled an abstract pattern to understand the problem:
I have a parent class of an outdated developer:
public class Developer<C>{
Rate<C> getRate(Taxes<C> tax){ }
}
I also purchased a Rentable legacy interface with an almost identical signature
public interface Rentable {
<C> Rate<C> getRate(Taxes<C> taxes);
}
Since the developer is not rented, in my model I create a special developer who is both a developer and a rented material.
public class OutsourcableDeveloper<C>
extends Developer<C>
implements Rentable{
@Override
public Rate<C> getRate(Taxes<C> taxes){ }
}
clash: getRate (Developer.Taxes) OutsourcableDeveloper , getRate (Developer.Taxes) ,
, OutsourcableDeveloper.getRate()
Developer, Rentable. getRate()?
, , , .
, , , ? , , , ?
EDIT: , , , , , , : " " ? "class generic" ,
EDIT2: ,