View Javadoc
1   /*
2    * ====================================================================
3    * Licensed to the Apache Software Foundation (ASF) under one
4    * or more contributor license agreements.  See the NOTICE file
5    * distributed with this work for additional information
6    * regarding copyright ownership.  The ASF licenses this file
7    * to you under the Apache License, Version 2.0 (the
8    * "License"); you may not use this file except in compliance
9    * with the License.  You may obtain a copy of the License at
10   *
11   *   http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing,
14   * software distributed under the License is distributed on an
15   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16   * KIND, either express or implied.  See the License for the
17   * specific language governing permissions and limitations
18   * under the License.
19   * ====================================================================
20   *
21   * This software consists of voluntary contributions made by many
22   * individuals on behalf of the Apache Software Foundation.  For more
23   * information on the Apache Software Foundation, please see
24   * <http://www.apache.org/>.
25   *
26   */
27  
28  package org.apache.hc.core5.http.message;
29  
30  import java.net.URI;
31  import java.net.URISyntaxException;
32  
33  import org.apache.hc.core5.http.HttpRequest;
34  import org.apache.hc.core5.net.URIAuthority;
35  
36  /**
37   * {@link HttpRequest} wrapper.
38   */
39  public class HttpRequestWrapper extends AbstractMessageWrapper implements HttpRequest {
40  
41      private final HttpRequest message;
42  
43      public HttpRequestWrapper(final HttpRequest message) {
44          super(message);
45          this.message = message;
46      }
47  
48      @Override
49      public String getMethod() {
50          return message.getMethod();
51      }
52  
53      @Override
54      public String getPath() {
55          return message.getPath();
56      }
57  
58      @Override
59      public void setPath(final String path) {
60          message.setPath(path);
61      }
62  
63      @Override
64      public String getScheme() {
65          return message.getScheme();
66      }
67  
68      @Override
69      public void setScheme(final String scheme) {
70          message.setScheme(scheme);
71      }
72  
73      @Override
74      public URIAuthority getAuthority() {
75          return message.getAuthority();
76      }
77  
78      @Override
79      public void setAuthority(final URIAuthority authority) {
80          message.setAuthority(authority);
81      }
82  
83      @Override
84      public String getRequestUri() {
85          return message.getRequestUri();
86      }
87  
88      @Override
89      public URI getUri() throws URISyntaxException {
90          return message.getUri();
91      }
92  
93  }