A HashMap essentially has O(1) performance while a switch state can have either O(1) or O(log(n)) depending on if the compiler uses a tableswitch or lookup switch.
Under
It depends:
If there are a few items | fixed items. Using switch if you can ( worst case O(n))
If there a a lot of items OR you want to add future items without modifying much code ---> Using hash-map ( access time is considered as constant time)
For your case. You should not worry about performance because the different execution time is very small. Just focus on readability/maintainability of your code. Is it worth to optimize a simple case to improve a few nanoseconds?