I see two strong reasons for the current implementation vs enum: 1. The default set of allowedMethods can be overridden. Potentially by custom (made up) HTTP methods that wouldn't match any enum value. 2. In the end, allowedMethods are being compared to HttpServletRequest.getMethod, which returns a String. I.e. String compared to String -- no conversions needed.
On Wednesday, October 31, 2018 at 5:39:15 PM UTC+1, Vijay Yalasangimath wrote: > > Hi > > I wanted to know why HTTP methods are not enums in AllowedMethodsFilter? > ( > https://github.com/dropwizard/dropwizard/blob/master/dropwizard-jersey/src/main/java/io/dropwizard/jersey/filter/AllowedMethodsFilter.java#L23 > ) > > I think Enum set will be a better option than a string set > for contains operation. > > Please help me to understand the idea behind it. > > Thank you > Vijay > > -- > -- You received this message because you are subscribed to the Google Groups "dropwizard-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
