public Route produces ( String ... types ) { Preconditions . checkNotNull ( types ) ; final ImmutableSet . Builder < MediaType > builder = new ImmutableSet . Builder <> ( ) ; builder . addAll ( this . producedMediaTypes ) ; for ( String s : types ) { final MediaType mt = MediaType . parse ( s ) ; if ( mt . hasWildcard ( ) ) { throw new RoutingException ( "A route cannot `produce` a mime type with a wildcard: " + mt ) ; } builder . add ( mt ) ; } this . producedMediaTypes = builder . build ( ) ; return this ; }
Sets the set of media types produced by the route .