Avoiding multiple If statements in Java

后端 未结 13 889
北恋
北恋 2020-12-30 07:52

I\'ve coded a method something like this. But I guess this should undergo refactoring. Can any one suggest the best approach to avoid using this multiple if statements?

13条回答
  •  抹茶落季
    2020-12-30 08:11

    You can always use a Groovy class here as it allows for switch-case on Strings :)

提交回复
热议问题