1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package io.netty.handler.codec.stomp;
18
19 import java.util.Iterator;
20 import java.util.List;
21 import java.util.Map.Entry;
22
23 import io.netty.handler.codec.CharSequenceValueConverter;
24 import io.netty.handler.codec.DefaultHeaders;
25 import io.netty.handler.codec.HeadersUtils;
26
27 import static io.netty.util.AsciiString.CASE_INSENSITIVE_HASHER;
28 import static io.netty.util.AsciiString.CASE_SENSITIVE_HASHER;
29
30 public class DefaultStompHeaders
31 extends DefaultHeaders<CharSequence, CharSequence, StompHeaders> implements StompHeaders {
32 public DefaultStompHeaders() {
33 super(CASE_SENSITIVE_HASHER, CharSequenceValueConverter.INSTANCE);
34 }
35
36 @Override
37 public String getAsString(CharSequence name) {
38 return HeadersUtils.getAsString(this, name);
39 }
40
41 @Override
42 public List<String> getAllAsString(CharSequence name) {
43 return HeadersUtils.getAllAsString(this, name);
44 }
45
46 @Override
47 public Iterator<Entry<String, String>> iteratorAsString() {
48 return HeadersUtils.iteratorAsString(this);
49 }
50
51 @Override
52 public boolean contains(CharSequence name, CharSequence value) {
53 return contains(name, value, false);
54 }
55
56 @Override
57 public boolean contains(CharSequence name, CharSequence value, boolean ignoreCase) {
58 return contains(name, value,
59 ignoreCase ? CASE_INSENSITIVE_HASHER : CASE_SENSITIVE_HASHER);
60 }
61
62 @Override
63 public DefaultStompHeaders copy() {
64 DefaultStompHeaders copyHeaders = new DefaultStompHeaders();
65 copyHeaders.addImpl(this);
66 return copyHeaders;
67 }
68 }