I want to call methods from an object from a switch statement.
Here I include String:
switch (properties.getProperty("my.property")) {
case contains("something"):
doSomething();
break;
}
Can I execute object methods switch' ed like this? I mainly try to avoid:
case properties.getProperty("my.property").contains("something"):
I'm sure this is a lost cause, but maybe I missed something ...
I tried to use contains()and to .contains()no avail. Should I just stop trying to be lazy? Or is there a way to do this?
source
share