private static PathMapping getPathMapping(String pathPattern) {
        requireNonNull(pathPattern, "pathPattern");
        if (pathPattern.startsWith(EXACT)) {
            return new ExactPathMapping(pathPattern.substring(EXACT.length()));
        }
        if (pathPattern.startsWith(PREFIX)) {
            final String prefix = pathPattern.substring(PREFIX.length());
            return prefixPathMapping(prefix, true);
        }
        if (pathPattern.startsWith(GLOB)) {
            final String glob = pathPattern.substring(GLOB.length());
            return globPathMapping(glob, 0);
        }
        if (pathPattern.startsWith(REGEX)) {
            return new RegexPathMapping(Pattern.compile(pathPattern.substring(REGEX.length())));
        }
        if (!pathPattern.startsWith("/")) {
            throw new IllegalArgumentException(
                    "pathPattern: " + pathPattern +
                    " (not an absolute path starting with '/' or a unknown pattern type)");
        }
        if (!pathPattern.contains("/{") && !pathPattern.contains("/:")) {
            return new ExactPathMapping(pathPattern);
        }
        return new ParameterizedPathMapping(pathPattern);
    }
Returns a newly-created {@link Route} based on the properties of this builder.
core/src/main/java/com/linecorp/armeria/server/RouteBuilder.java