1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.eclipse.jetty.spdy.frames;
18
19 import java.util.HashMap;
20 import java.util.Map;
21
22 public enum ControlFrameType
23 {
24 SYN_STREAM((short)1),
25 SYN_REPLY((short)2),
26 RST_STREAM((short)3),
27 SETTINGS((short)4),
28 NOOP((short)5),
29 PING((short)6),
30 GO_AWAY((short)7),
31 HEADERS((short)8),
32 WINDOW_UPDATE((short)9);
33
34 public static ControlFrameType from(short code)
35 {
36 return Codes.codes.get(code);
37 }
38
39 private final short code;
40
41 private ControlFrameType(short code)
42 {
43 this.code = code;
44 Codes.codes.put(code, this);
45 }
46
47 public short getCode()
48 {
49 return code;
50 }
51
52 private static class Codes
53 {
54 private static final Map<Short, ControlFrameType> codes = new HashMap<>();
55 }
56 }