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    * https://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.EmptyHeaders;
19  
20  public final class EmptyHttp2Headers
21          extends EmptyHeaders<CharSequence, CharSequence, Http2Headers> implements Http2Headers {
22      public static final EmptyHttp2Headers INSTANCE = new EmptyHttp2Headers();
23  
24      private EmptyHttp2Headers() {
25      }
26  
27      @Override
28      public EmptyHttp2Headers method(CharSequence method) {
29          throw new UnsupportedOperationException();
30      }
31  
32      @Override
33      public EmptyHttp2Headers scheme(CharSequence status) {
34          throw new UnsupportedOperationException();
35      }
36  
37      @Override
38      public EmptyHttp2Headers authority(CharSequence authority) {
39          throw new UnsupportedOperationException();
40      }
41  
42      @Override
43      public EmptyHttp2Headers path(CharSequence path) {
44          throw new UnsupportedOperationException();
45      }
46  
47      @Override
48      public EmptyHttp2Headers status(CharSequence status) {
49          throw new UnsupportedOperationException();
50      }
51  
52      @Override
53      public CharSequence method() {
54          return get(PseudoHeaderName.METHOD.value());
55      }
56  
57      @Override
58      public CharSequence scheme() {
59          return get(PseudoHeaderName.SCHEME.value());
60      }
61  
62      @Override
63      public CharSequence authority() {
64          return get(PseudoHeaderName.AUTHORITY.value());
65      }
66  
67      @Override
68      public CharSequence path() {
69          return get(PseudoHeaderName.PATH.value());
70      }
71  
72      @Override
73      public CharSequence status() {
74          return get(PseudoHeaderName.STATUS.value());
75      }
76  
77      @Override
78      public boolean contains(CharSequence name, CharSequence value, boolean caseInsensitive) {
79          return false;
80      }
81  }