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

tech.kronicle.utils.UriVariablesBuilder 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.HashMap;
import java.util.Map;

public class UriVariablesBuilder {

    private final Map uriVariables = new HashMap<>();

    private UriVariablesBuilder() {
    }

    public static UriVariablesBuilder builder() {
        return new UriVariablesBuilder();
    }

    public UriVariablesBuilder addUriVariable(String name, Object value) {
        if (uriVariables.containsKey(name)) {
            throw new UnsupportedOperationException(String.format("Name %s already exists", name));
        }

        uriVariables.put(name, value.toString());
        return this;
    }

    public Map build() {
        return Map.copyOf(uriVariables);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy