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