In UML models, enumerations are model elements in class diagrams that represent user-defined data types. Enumerations contain sets of named identifiers that represent the values of the enumeration. These values are called enumeration literals.
You can add enumerations to models that represent software systems to depict discrete sets of values. Enumerations can represent primitive types, such as Integer and Boolean types, or user-defined types.
An enumeration has a name that describes its role in a model. The diagram editor displays an enumeration as a rectangle with two compartments:
Your models can include user-defined enumerations such as one that defines the days of the week. For example, an enumeration called Day has enumeration literals of Monday, Tuesday, Wednesday, and so on.
You can also model the primitive data types in many programming languages. For example, the Boolean data type has enumeration literals of true and false.