mercredi 6 février 2019

lookup method from config java

What would be the better approach to do invoke method based on config value.

List<String> configs = "from config file"

for(string config : configs) {
    if (config.equal("method1")) {
        someObj.method1();
    } else if(config.equal("method21")) {
        someObj2.method21()
    }
}

Aucun commentaire:

Enregistrer un commentaire