code: 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;
      }
docs: Allows to wire a route to a controller.
  
  @param type class of controller to which a route is mapped
  @return instance of {@link RouteBuilder}.