public Route accepts ( String ... types ) { Preconditions . checkNotNull ( types ) ; final ImmutableSet . Builder < MediaType > builder = new ImmutableSet . Builder <> ( ) ; builder . addAll ( this . acceptedMediaTypes ) ; for ( String s : types ) { builder . add ( MediaType . parse ( s ) ) ; } this . acceptedMediaTypes = builder . build ( ) ; return this ; }
Sets the set of media types accepted by the route .