What is an Enum Type?

#1

I see some types that leverage the enum key word in the Type Definition, and I also see that there is a C3 Type: Enum that I have c3ShowType(Enum) and see that there are some methods defined on that type. Is there a clear, succinct definition of what an enum type is somewhere someone can point me to, otherwise, we can document it in this post.

enum type TypeName {
fields…
}

0 Likes

#2

enum type TypeName is equivalent to typeName mixes Enum<TypeName>

similarly to how entity type TypeName is equivalent to type TypeName mixes Persistable<TypeName>

enums (or enumerations) are useful for listing a set of possible values. This is a common concept across many languages. Here is a pretty good java doc about their enum concept (which is very similar to ours) https://docs.oracle.com/javase/tutorial/java/javaOO/enum.html

0 Likes