001/* 002 * Copyright 2002-2018 the original author or authors. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * https://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017package org.springframework.web.util; 018 019import java.net.URI; 020import java.util.Map; 021 022/** 023 * Defines methods for expanding a URI template with variables. 024 * 025 * @author Rossen Stoyanchev 026 * @since 4.2 027 * @see org.springframework.web.client.RestTemplate#setUriTemplateHandler(UriTemplateHandler) 028 */ 029public interface UriTemplateHandler { 030 031 /** 032 * Expand the given URI template with a map of URI variables. 033 * @param uriTemplate the URI template 034 * @param uriVariables variable values 035 * @return the created URI instance 036 */ 037 URI expand(String uriTemplate, Map<String, ?> uriVariables); 038 039 /** 040 * Expand the given URI template with an array of URI variables. 041 * @param uriTemplate the URI template 042 * @param uriVariables variable values 043 * @return the created URI instance 044 */ 045 URI expand(String uriTemplate, Object... uriVariables); 046 047}