This is a bit of a specific question, but I want to know how to make a HashMap of functions that are obtained in parameters, like so:
//All functions will take in string and return void
public HashMap<String,Function> functions = new HashMap<String,Function>();
public void addMethod(String name, Function func){
functions.put(name, func);
}
public void useMethod(String name, String input){
functions[name](input);
}
How would I do this correctly?