public void withRoutes ( MangooRoute ... routes ) { Objects . requireNonNull ( routes , Required . ROUTE . toString ( ) ) ; for ( MangooRoute route : routes ) { RequestRoute requestRoute = ( RequestRoute ) route ; requestRoute . withControllerClass ( this . controllerClass ) ; if ( hasBasicAuthentication ( ) ) { requestRoute . withBasicAuthentication ( this . username , this . password , this . secret ) ; } if ( hasAuthentication ( ) ) { requestRoute . withAuthentication ( ) ; } if ( hasAuthorization ( ) ) { requestRoute . withAuthorization ( ) ; } if ( hasBlocking ( ) ) { requestRoute . withNonBlocking ( ) ; } if ( requestRoute . getLimit ( ) == 0 ) { requestRoute . withRequestLimit ( this . limit ) ; } if ( requestRoute . hasMultipleMethods ( ) ) { for ( Http method : requestRoute . getMethods ( ) ) { requestRoute . withHttpMethod ( method ) ; Router . addRoute ( requestRoute ) ; } } else { Router . addRoute ( requestRoute ) ; } } }
Sets the given routes to the defined controller class