1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package io.netty.handler.codec.quic;
17
18 import io.netty.util.internal.ObjectUtil;
19
20 import java.util.Objects;
21
22
23
24
25 public final class QuicStreamPriority {
26
27 private final int urgency;
28 private final boolean incremental;
29
30
31
32
33
34
35
36 public QuicStreamPriority(int urgency, boolean incremental) {
37 this.urgency = ObjectUtil.checkInRange(urgency, 0, Byte.MAX_VALUE, "urgency");
38 this.incremental = incremental;
39 }
40
41
42
43
44
45
46 public int urgency() {
47 return urgency;
48 }
49
50
51
52
53
54
55 public boolean isIncremental() {
56 return incremental;
57 }
58
59 @Override
60 public boolean equals(Object o) {
61 if (this == o) {
62 return true;
63 }
64 if (o == null || getClass() != o.getClass()) {
65 return false;
66 }
67 QuicStreamPriority that = (QuicStreamPriority) o;
68 return urgency == that.urgency && incremental == that.incremental;
69 }
70
71 @Override
72 public int hashCode() {
73 return Objects.hash(urgency, incremental);
74 }
75
76 @Override
77 public String toString() {
78 return "QuicStreamPriority{" +
79 "urgency=" + urgency +
80 ", incremental=" + incremental +
81 '}';
82 }
83 }