I need to create a base class that implements several interfaces with lots of methods, example below.
Is there an easier way to delegate these method calls without having to create a horde of duplicate methods?
public class MultipleInterfaces implements InterFaceOne, InterFaceTwo {
private InterFaceOne if1;
private InterFaceTwo if2;
public MultipleInterfaces() {
if1 = new ImplementingClassOne();
if2 = new ImplementingClassTwo();
}
@Override
public void classOneMethodOne { if1.methodOne(); }
@Override
public void classOneMethodTwo { if1.methodTwo(); }
/** Etc. */
@Override
public void classTwoMethodOne { if2.methodOne(); }
@Override
public void classTwoMethodTwo { if2.methodTwo(); }
/** Etc. */
}