If have an enum in e.g. Day with SunDay, MunDay, etc. Is there an easy way to generate the switch statement as below ? There is so much to much by hand.
switch(day) {
case SunDay :
break;
case MunDay :
break;
// and so on
}
If you are using Eclipse IDE, you can construct a empty switch, and Eclipse will give you an option called 'Add missing case statements' to automatically generate the switch. See the imagem below:
(Open the image in another window to see it better.)

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With