tech.kronicle.utils.UriTemplateUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kronicle-utils Show documentation
Show all versions of kronicle-utils Show documentation
Kronicle utils library that contains utility classes for use by Kronicle and its plugins
package tech.kronicle.utils;
import java.util.Map;
public final class UriTemplateUtils {
public static String expandUriTemplate(String uriTemplate, Map uriVariables) {
return uriVariables.entrySet().stream().reduce(
uriTemplate,
(updatedUriTemplate, uriVariable) -> updatedUriTemplate.replace("{" + uriVariable.getKey() + "}", uriVariable.getValue()),
(a, b) -> { throw new IllegalStateException("combiner function should not be used as this is not a parallel stream"); }
);
}
private UriTemplateUtils() {
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy