A class has a reference to another instance (autowired via Spring)
public class Instance1 {
public void m1(String args) {
System.out.println(arg);
}
public void m2(String args) {
System.out.println(arg);
}
public void m3(String args) {
System.out.println(arg);
}
}
public class process() {
@AutoWire
public Instance1 instance1
public void processA() {
// Get a reference to m1, m2, or m3
processB(<pass referrnce here>);
}
public void processB(<accept reference to m1, m2 , m3 here>) {
// Call either m1, m2, or m3
}
}
That instance includes 3 methods, let's say m1, m2 and m3. I want to be able to set a reference to each of those methods and pass it as a parameter to another local method, which will call either m1, m2 and m3.