com.github.hal4j.resources.curie.TemplateCurieResolver Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hal4j-api Show documentation
Show all versions of hal4j-api Show documentation
HAL API specification for Java
package com.github.hal4j.resources.curie;
import com.github.hal4j.uritemplate.URITemplate;
import static com.github.hal4j.uritemplate.URIFactory.templateUri;
public class TemplateCurieResolver implements CurieResolver {
private URITemplate template;
public static TemplateCurieResolver curie(String templateString) {
return new TemplateCurieResolver(templateUri(templateString));
}
public TemplateCurieResolver(URITemplate template) {
this.template = template;
}
@Override
public URITemplate resolve(String namespace) {
return template.expand("ns", namespace);
}
}