Part 1
Learning enumeratum, part 1: why not just use scala.Enumeration?
Three ways to model an enum in Scala 2.13 (Enumeration, sealed traits, and enumeratum), with runnable code, and why my team settled on enumeratum.
Series
A hands-on, lesson-by-lesson walk through enumeratum, the Scala library that turns sealed traits into real enums: autogenerated values, safe parsing from strings, and integrations with JSON and databases. Each post starts from runnable sbt code on Scala 2.13 and compares it with what plain Scala gives you, scala.Enumeration and hand-rolled case objects, so you see why teams reach for it.
Part 1
Three ways to model an enum in Scala 2.13 (Enumeration, sealed traits, and enumeratum), with runnable code, and why my team settled on enumeratum.
Part 2
Overriding entryName for legacy strings, naming mixins, enum entries that carry data, and IntEnum/StringEnum, where duplicate codes fail to compile.
Part 3
CirceEnum and IntCirceEnum give every enum a JSON codec that follows entryName or value. Decoding is strict by default, and here's how the failures look and how to relax them on purpose.
Next in this series: Stay tuned! — coming soon.