1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package io.netty.handler.codec.spdy;
17
18 import static io.netty.util.internal.ObjectUtil.checkPositive;
19 import static io.netty.util.internal.ObjectUtil.checkPositiveOrZero;
20
21 import io.netty.util.internal.StringUtil;
22
23
24
25
26 public class DefaultSpdyWindowUpdateFrame implements SpdyWindowUpdateFrame {
27
28 private int streamId;
29 private int deltaWindowSize;
30
31
32
33
34
35
36
37 public DefaultSpdyWindowUpdateFrame(int streamId, int deltaWindowSize) {
38 setStreamId(streamId);
39 setDeltaWindowSize(deltaWindowSize);
40 }
41
42 @Override
43 public int streamId() {
44 return streamId;
45 }
46
47 @Override
48 public SpdyWindowUpdateFrame setStreamId(int streamId) {
49 checkPositiveOrZero(streamId, "streamId");
50 this.streamId = streamId;
51 return this;
52 }
53
54 @Override
55 public int deltaWindowSize() {
56 return deltaWindowSize;
57 }
58
59 @Override
60 public SpdyWindowUpdateFrame setDeltaWindowSize(int deltaWindowSize) {
61 checkPositive(deltaWindowSize, "deltaWindowSize");
62 this.deltaWindowSize = deltaWindowSize;
63 return this;
64 }
65
66 @Override
67 public String toString() {
68 return new StringBuilder()
69 .append(StringUtil.simpleClassName(this))
70 .append(StringUtil.NEWLINE)
71 .append("--> Stream-ID = ")
72 .append(streamId())
73 .append(StringUtil.NEWLINE)
74 .append("--> Delta-Window-Size = ")
75 .append(deltaWindowSize())
76 .toString();
77 }
78 }