mangstadt / biweekly

biweekly is an iCalendar library written in Java.
BSD 2-Clause "Simplified" License
323 stars 44 forks source link

EnumProperty could be Enums #56

Closed philipwhiuk closed 8 years ago

philipwhiuk commented 8 years ago

I'm curious why EnumProperty classes like Method aren't Java enums.

It would seem to make it much easier to parse them.

Even not being enums, one can't even do:

switch(method.getValue()) { case Method.PUBLISH: }

because Method.PUBLISH is private.

mangstadt commented 8 years ago

They're not enums because it's possible to assign any value to a property (for example, METHOD:FOOBAR).

Good point about the string constants being private. I made them public in 4ad593f107cc1b58fca87fb5f5cba15a7a9b9b09.