All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tech.kronicle.utils.UriTemplateUtils Maven / Gradle / Ivy

Go to download

Kronicle utils library that contains utility classes for use by Kronicle and its plugins

There is a newer version: 0.1.331
Show newest version
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