static final List findNamesInTemplate()

in client/src/main/java/org/apache/rocketmq/schema/registry/client/rest/UrlBuilder.java [156:174]


    static final List<String> findNamesInTemplate(String path) {
        int counter = 0;
        List<String> templateNames = new ArrayList<>();
        StringBuilder sb = null;
        while (counter < path.length()) {
            char c = path.charAt(counter++);
            if (c == '{' && sb == null) {
                sb = new StringBuilder();
            }
            if (sb != null) {
                sb.append(c);
            }
            if (c == '}' && sb != null) {
                templateNames.add(sb.toString());
                sb = null;
            }
        }
        return Collections.unmodifiableList(templateNames);
    }