I've to store hard-coded value in my environment files like this:
- folder.canada.6m.ind=150992762918
- folder.canada.9m.group=150992760518
- folder.usa.1m.ind=150992762995
There are 3 parameters (String country, String months, String category) which I receive from the end user and I've to pick the corresponding value from env files.
I can do it using brute force like,
if(country.equals(canada) && months.equals(6m) && category.equals(ind)) {
return folder.canada.6m.ind;
}
There are other ways to do it using if-else as well but I have 100's of these values so I don't think the best way to solve this problem is using if-else. What would be the best data structure or method to solve this problem?
I'm using spring-boot in Java.