Typesafe Enum Design Pattern


Graphical Representation:



Definition

Define a class representing a single element of the enumerated type and provide no public constructor. An enumeration is a new type since Java 5 (jdk1.5). Before jdk1.4, you can create a similar type that is much better and type safe. This is so-called Typesafe Enum pattern.



Where to use & benefits

Alter or expand the class later safely.