Example usage for org.springframework.hateoas UriTemplate UriTemplate

List of usage examples for org.springframework.hateoas UriTemplate UriTemplate

Introduction

In this page you can find the example usage for org.springframework.hateoas UriTemplate UriTemplate.

Prototype

@Deprecated
public UriTemplate(String baseUri, TemplateVariables variables) 

Source Link

Document

Creates a new UriTemplate from the given base URI and TemplateVariables .

Usage

From source file:io.spring.initializr.web.mapper.InitializrMetadataV2JsonMapper.java

private String generateTemplatedUri(String appUrl, Type type) {
    String uri = appUrl != null ? appUrl + type.getAction() : type.getAction();
    uri = uri + "?type=" + type.getId();
    UriTemplate uriTemplate = new UriTemplate(uri, this.templateVariables);
    return uriTemplate.toString();
}

From source file:io.spring.initializr.web.mapper.InitializrMetadataV21JsonMapper.java

private Map<String, Object> dependenciesLink(String appUrl) {
    String uri = appUrl != null ? appUrl + "/dependencies" : "/dependencies";
    UriTemplate uriTemplate = new UriTemplate(uri, this.dependenciesVariables);
    Map<String, Object> result = new LinkedHashMap<>();
    result.put("href", uriTemplate.toString());
    result.put("templated", true);
    return result;
}