Naming of enums in Java: Singular or Plural?
enums, java, naming-conventions
Solution
Enums in Java (and probably enums in general) should be singular. The thinking is that you're not selecting multiple Protocols, but rather one Protocol of the possible choices in the list of values.
Note the absence of plurals: http://docs.oracle.com/javase/tutorial/java/javaOO/enum.html
Problem
Is there an "official" recommendation of how to name Java enums? ``` enum Protocol { HTTP, HTTPS, FTP } ``` or ``` enum Protocols { HTTP, HTTPS, FTP } ``` I know in the .Net world the recommendation is to use singular except for enums that represent bit flags. Just curious if there is something similar in Java. A related question that seems to be .Net specific: Singular or plural for enumerations?