It's generally known as an 'enum', after the C construct of that name.
You can easily create your own class, objects of which must be initialised with values from a set, and you can create the appropriate comparison, equality, and truth functions accordingly.