public static Set < MediaType > set ( String ... types ) { Set < MediaType > set = new HashSet < MediaType > ( ) ; for ( String type : types ) { MediaType mt = parse ( type ) ; if ( mt != null ) { set . add ( mt ) ; } } return Collections . unmodifiableSet ( set ) ; }
Convenience method that parses the given media type strings and returns an unmodifiable set that contains all the parsed types .