go through enum class value as loop code example
Example 1: iterate through an enum java
for (enumerator s : enumerator.values()) {
// do abc
}
Example 2: java loop through enum
for (Direction dir : Direction.values()) {
// do what you want
}