I am refactoring code... Considering this chain of inheritance...
public class Base
public class Simple extends Base
public class Secure extends Simple
public class Framework extends Secure
public class Application extends Framework
and the class
public class ApplicationCallback
Currently, ApplicationCallback has this method public abstract ApplicationCallback#doSomething(Application app), but I want it to be accessible by Base.... without changing the code everywhere from ApplicationCallback#doSomething(Application app) to ApplicationCallback#doSomething(Base base).
Is there a way I can define a method that I can define to prevent the code change everywhere?
Kind of like ApplicationCallback#doSomething(T<? extends Base> app), so that when overriding, I can just put ApplicationCallback#doSomething(Base base) and ApplicationCallback#doSomething(Simple simple) etc etc.
The question is about @Override ApplicationCallback#doSomething()
Base".ApplicationCallback#doSomething(Application app)toApplicationCallback#doSomething(Base base)" - You wouldn't have to change the calling sides since you widen the parameter type fromApplicationtoBase.@Override, it would have to be changed toApplicationCallback#doSomething(Base base). Is there a way to make it generic so that anything that extendsBaseis acceptable in the method input?ApplicationCallback