I'm still kinda new to Groovy, just used it in a program called FileBot. Anyway, to sort some things well, without writing 10,000 lines of code, I want to be able use a range as the key in a map. So basically what I want to do is if 'a' is between '1' and '10' return 'x' value. I know I could write it out as {a >= 1 && <=10 ? 'Do This' : null}
but that would be a lot more writing to do that. Also, I obviously want to use this for multiple different ranges, or this wouldn't be an issue.
Similarly, if there is any easier way to do this, I thought maybe with a csv file, but I'm not sure how exactly.
Any help is much appreciated!
1..10
as akey
in aMap
andx
as it's value, right?