@@ -0,0 +1,2989 @@
+/*%0A * Copyright 2015 Open mHealth%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.openmhealth.shimmer.common.domain;%0A%0Aimport org.springframework.http.HttpMethod;%0Aimport org.springframework.http.RequestEntity;%0Aimport org.springframework.util.LinkedMultiValueMap;%0Aimport org.springframework.util.MultiValueMap;%0Aimport org.springframework.web.util.UriTemplate;%0A%0Aimport static com.google.common.base.Preconditions.checkArgument;%0Aimport static com.google.common.base.Preconditions.checkNotNull;%0A%0A%0A/**%0A * A builder that constructs a %7B@link RequestEntity%7D.%0A *%0A * @author Emerson Farrugia%0A * @author Chris Schaefbauer%0A */%0Apublic class RequestEntityBuilder %7B%0A%0A    private UriTemplate uriTemplate;%0A    private HttpMethod httpMethod = HttpMethod.GET;%0A    private MultiValueMap%3CString, String%3E headers = new LinkedMultiValueMap%3C%3E();%0A    private MultiValueMap%3CString, String%3E queryParameters = new LinkedMultiValueMap%3C%3E();%0A%0A%0A    /**%0A     * @param uriTemplate the request entity URI as a template%0A     */%0A    public RequestEntityBuilder(UriTemplate uriTemplate) %7B%0A%0A        checkNotNull(uriTemplate);%0A%0A        this.uriTemplate = uriTemplate;%0A    %7D%0A%0A    /**%0A     * @return the request entity URI as a template%0A     */%0A    public UriTemplate getUriTemplate() %7B%0A        return uriTemplate;%0A    %7D%0A%0A    /**%0A     * @return the method to use to exchange the request entity%0A     */%0A    public HttpMethod getHttpMethod() %7B%0A        return httpMethod;%0A    %7D%0A%0A    public void setHttpMethod(HttpMethod httpMethod) %7B%0A%0A        checkNotNull(httpMethod);%0A%0A        this.httpMethod = httpMethod;%0A    %7D%0A%0A    /**%0A     * @param name the name of the header to add%0A     * @param value the value of the header%0A     */%0A    public void addHeader(String name, String value) %7B%0A%0A        addToMultiValueMap(headers, name, value);%0A    %7D%0A%0A    /**%0A     * @param name the name of the query parameter to add%0A     * @param value the value of the parameter%0A     */%0A    public void addQueryParameter(String name, String value) %7B%0A%0A        addToMultiValueMap(queryParameters, name, value);%0A    %7D%0A%0A    private void addToMultiValueMap(MultiValueMap%3CString, String%3E map, String key, String value) %7B%0A%0A        checkNotNull(key);%0A        checkArgument(!key.isEmpty());%0A        checkNotNull(value);%0A        checkArgument(!value.isEmpty());%0A%0A        map.add(key, value);%0A    %7D%0A%0A    /**%0A     * @return the request entity%0A     */%0A    public RequestEntity%3C?%3E build() %7B%0A%0A        // FIXME implement me%0A        return null;%0A    %7D%0A%7D%0A

Add a skeletal request entity builder