public < T extends AppController > RouteBuilder to ( Class < T > type ) { boolean hasControllerSegment = false ; for ( Segment segment : segments ) { hasControllerSegment = segment . controller ; } if ( type != null && hasControllerSegment ) { throw new IllegalArgumentException ( "Cannot combine {controller} segment and .to(\"...\") method. Failed route: " + routeConfig ) ; } this . type = type ; return this ; }
Allows to wire a route to a controller .