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

com.github.hal4j.resources.curie.MapBasedCurieResolver Maven / Gradle / Ivy

There is a newer version: 1.1.0
Show newest version
package com.github.hal4j.resources.curie;

import com.github.hal4j.uritemplate.URITemplate;

import java.util.HashMap;
import java.util.Map;

public class MapBasedCurieResolver implements CurieResolver {

    private Map mappings = new HashMap<>();

    public MapBasedCurieResolver() {
    }

    public MapBasedCurieResolver(String rel, URITemplate template) {
        this.mappings.put(rel, template);
    }

    public MapBasedCurieResolver add(String rel, URITemplate template) {
        this.mappings.put(rel, template);
        return this;
    }

    public URITemplate resolve(String uri) {
        return mappings.get(uri);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy