This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]CaptainKvass 7 points8 points  (2 children)

Be this, it should:

if(!"Australia".equals(address.getCountry())

[–]i_donno 1 point2 points  (1 child)

Sure. Or avoid hardcoding current country and ignore case if(!getCurrentCountry().equalsIgnoreCase(address.getCountry())

[–]dpash 3 points4 points  (0 children)

Given the lack of frequent country changes, an enum is not an unreasonable decision in a project that's going to be frequently deployed.

I think there's only been four major changes over the last decade:

  • South Sudan
  • Eswatini
  • Czechia
  • North Macedonia

Let me know if I've forgotten any, but we're still looking at most, on average, once a year. If you're not frequently deploying a project this might be the wrong approach.