private static EnumSet < CorsHttpMethods > splitToEnumSet ( String str , String delimiter ) { EnumSet < CorsHttpMethods > set = EnumSet . noneOf ( CorsHttpMethods . class ) ; StringTokenizer st = new StringTokenizer ( str , delimiter ) ; while ( st . hasMoreElements ( ) ) { set . add ( CorsHttpMethods . valueOf ( st . nextToken ( ) ) ) ; } return set ; }
Split a delimiter separated string into a EnumSet of CorsHttpMethods