View Javadoc
1   /*
2    * Copyright 2014 The Netty Project
3    *
4    * The Netty Project licenses this file to you under the Apache License, version 2.0 (the
5    * "License"); you may not use this file except in compliance with the License. You may obtain a
6    * copy of the License at:
7    *
8    * http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software distributed under the License
11   * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12   * or implied. See the License for the specific language governing permissions and limitations under
13   * the License.
14   */
15  
16  package io.netty.handler.codec.http2;
17  
18  import io.netty.handler.codec.AsciiString;
19  import io.netty.handler.codec.BinaryHeaders;
20  import io.netty.handler.codec.EmptyBinaryHeaders;
21  
22  public final class EmptyHttp2Headers extends EmptyBinaryHeaders implements Http2Headers {
23      public static final EmptyHttp2Headers INSTANCE = new EmptyHttp2Headers();
24  
25      private EmptyHttp2Headers() {
26      }
27  
28      @Override
29      public Http2Headers add(AsciiString name, AsciiString value) {
30          super.add(name, value);
31          return this;
32      }
33  
34      @Override
35      public Http2Headers add(AsciiString name, Iterable<? extends AsciiString> values) {
36          super.add(name, values);
37          return this;
38      }
39  
40      @Override
41      public Http2Headers add(AsciiString name, AsciiString... values) {
42          super.add(name, values);
43          return this;
44      }
45  
46      @Override
47      public Http2Headers addObject(AsciiString name, Object value) {
48          super.addObject(name, value);
49          return this;
50      }
51  
52      @Override
53      public Http2Headers addObject(AsciiString name, Iterable<?> values) {
54          super.addObject(name, values);
55          return this;
56      }
57  
58      @Override
59      public Http2Headers addObject(AsciiString name, Object... values) {
60          super.addObject(name, values);
61          return this;
62      }
63  
64      @Override
65      public Http2Headers addBoolean(AsciiString name, boolean value) {
66          super.addBoolean(name, value);
67          return this;
68      }
69  
70      @Override
71      public Http2Headers addChar(AsciiString name, char value) {
72          super.addChar(name, value);
73          return this;
74      }
75  
76      @Override
77      public Http2Headers addByte(AsciiString name, byte value) {
78          super.addByte(name, value);
79          return this;
80      }
81  
82      @Override
83      public Http2Headers addShort(AsciiString name, short value) {
84          super.addShort(name, value);
85          return this;
86      }
87  
88      @Override
89      public Http2Headers addInt(AsciiString name, int value) {
90          super.addInt(name, value);
91          return this;
92      }
93  
94      @Override
95      public Http2Headers addLong(AsciiString name, long value) {
96          super.addLong(name, value);
97          return this;
98      }
99  
100     @Override
101     public Http2Headers addFloat(AsciiString name, float value) {
102         super.addFloat(name, value);
103         return this;
104     }
105 
106     @Override
107     public Http2Headers addDouble(AsciiString name, double value) {
108         super.addDouble(name, value);
109         return this;
110     }
111 
112     @Override
113     public Http2Headers addTimeMillis(AsciiString name, long value) {
114         super.addTimeMillis(name, value);
115         return this;
116     }
117 
118     @Override
119     public Http2Headers add(BinaryHeaders headers) {
120         super.add(headers);
121         return this;
122     }
123 
124     @Override
125     public Http2Headers set(AsciiString name, AsciiString value) {
126         super.set(name, value);
127         return this;
128     }
129 
130     @Override
131     public Http2Headers set(AsciiString name, Iterable<? extends AsciiString> values) {
132         super.set(name, values);
133         return this;
134     }
135 
136     @Override
137     public Http2Headers set(AsciiString name, AsciiString... values) {
138         super.set(name, values);
139         return this;
140     }
141 
142     @Override
143     public Http2Headers setObject(AsciiString name, Object value) {
144         super.setObject(name, value);
145         return this;
146     }
147 
148     @Override
149     public Http2Headers setObject(AsciiString name, Iterable<?> values) {
150         super.setObject(name, values);
151         return this;
152     }
153 
154     @Override
155     public Http2Headers setObject(AsciiString name, Object... values) {
156         super.setObject(name, values);
157         return this;
158     }
159 
160     @Override
161     public Http2Headers setBoolean(AsciiString name, boolean value) {
162         super.setBoolean(name, value);
163         return this;
164     }
165 
166     @Override
167     public Http2Headers setChar(AsciiString name, char value) {
168         super.setChar(name, value);
169         return this;
170     }
171 
172     @Override
173     public Http2Headers setByte(AsciiString name, byte value) {
174         super.setByte(name, value);
175         return this;
176     }
177 
178     @Override
179     public Http2Headers setShort(AsciiString name, short value) {
180         super.setShort(name, value);
181         return this;
182     }
183 
184     @Override
185     public Http2Headers setInt(AsciiString name, int value) {
186         super.setInt(name, value);
187         return this;
188     }
189 
190     @Override
191     public Http2Headers setLong(AsciiString name, long value) {
192         super.setLong(name, value);
193         return this;
194     }
195 
196     @Override
197     public Http2Headers setFloat(AsciiString name, float value) {
198         super.setFloat(name, value);
199         return this;
200     }
201 
202     @Override
203     public Http2Headers setDouble(AsciiString name, double value) {
204         super.setDouble(name, value);
205         return this;
206     }
207 
208     @Override
209     public Http2Headers setTimeMillis(AsciiString name, long value) {
210         super.setTimeMillis(name, value);
211         return this;
212     }
213 
214     @Override
215     public Http2Headers set(BinaryHeaders headers) {
216         super.set(headers);
217         return this;
218     }
219 
220     @Override
221     public Http2Headers setAll(BinaryHeaders headers) {
222         super.setAll(headers);
223         return this;
224     }
225 
226     @Override
227     public Http2Headers clear() {
228         super.clear();
229         return this;
230     }
231 
232     @Override
233     public EmptyHttp2Headers method(AsciiString method) {
234         throw new UnsupportedOperationException();
235     }
236 
237     @Override
238     public EmptyHttp2Headers scheme(AsciiString status) {
239         throw new UnsupportedOperationException();
240     }
241 
242     @Override
243     public EmptyHttp2Headers authority(AsciiString authority) {
244         throw new UnsupportedOperationException();
245     }
246 
247     @Override
248     public EmptyHttp2Headers path(AsciiString path) {
249         throw new UnsupportedOperationException();
250     }
251 
252     @Override
253     public EmptyHttp2Headers status(AsciiString status) {
254         throw new UnsupportedOperationException();
255     }
256 
257     @Override
258     public AsciiString method() {
259         return get(PseudoHeaderName.METHOD.value());
260     }
261 
262     @Override
263     public AsciiString scheme() {
264         return get(PseudoHeaderName.SCHEME.value());
265     }
266 
267     @Override
268     public AsciiString authority() {
269         return get(PseudoHeaderName.AUTHORITY.value());
270     }
271 
272     @Override
273     public AsciiString path() {
274         return get(PseudoHeaderName.PATH.value());
275     }
276 
277     @Override
278     public AsciiString status() {
279         return get(PseudoHeaderName.STATUS.value());
280     }
281 }