public Route build() {
        checkState(pathMapping != null, "Must set a path before calling this.");
        if ((!consumes.isEmpty() || !produces.isEmpty()) && methods.isEmpty()) {
            throw new IllegalStateException("Must set methods if consumes or produces is not empty." +
                                            " consumes: " + consumes + ", produces: " + produces);
        }
        final Set<HttpMethod> pathMethods = methods.isEmpty() ? HttpMethod.knownMethods() : methods;
        return new DefaultRoute(pathMapping, pathMethods, consumes, produces,
                                paramPredicates, headerPredicates, isFallback, excludedRoutes);
    }
Returns a newly-created {@link Route} based on the properties of this builder.
core/src/main/java/com/linecorp/armeria/server/RouteBuilder.java