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