How can I explicitly define what values can given variable have? Let's say I want value of variable size to be either 'small', 'medium', or 'big' and nothing else.
EDIT: I want to avoid a situation when variable is set to something from beyond the list (for example to 'tiny' in this case). Like enum in Java. This variable would be a class field.
sizevariable would be type string, unlesssmall,medium, andlargeare variables that are assigned to integers. Please clarify your question though, because as of now, it is very ambiguous .