In Java we use enum to represent fixed set of constants
For example, we would define days of week enum type as follows
public enum Day { SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY }
In Scala, we can do the same thing by extending Enumeration, for example
object Day extends Enumeration { type Day = Value val SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY = Value }
You can find examples of Scala Enumeration usage in Spark
https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/TaskState.scala