-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQoS.java
More file actions
34 lines (28 loc) · 705 Bytes
/
QoS.java
File metadata and controls
34 lines (28 loc) · 705 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
* This class implements an enum containing the different Quality of Service
* possible.
*/
/**
* INFO0010 - Introduction to Computer Networking @Uliège
* Second part of the assignment
* Academic year 2021-2022
* @author Tristan Catteeuw - s161627 | Brieuc Jamoulle - s151977
*/
public enum QoS {
AT_MOST_ONCE (0),
AT_LEAST_ONE (1),
EXACTLY_ONE (2);
private int value;
QoS (int value) {
this.value = value;
}
public int getValue() {
return this.value;
}
public static QoS valueOf(int value) {
for (QoS q : QoS.values()) {
if (q.value == value) return q;
}
throw new IllegalArgumentException("Packet Type not valid!");
}
}