1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
package javax.jmdns.impl.constants; |
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
@author |
10 |
|
|
|
|
| 0% |
Uncovered Elements: 17 (17) |
Complexity: 6 |
Complexity Density: 0.6 |
|
11 |
|
public enum DNSOperationCode { |
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
Query("Query", 0), |
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
IQuery("Inverse Query", 1), |
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
Status("Status", 2), |
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
Unassigned("Unassigned", 3), |
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
Notify("Notify", 4), |
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
Update("Update", 5); |
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
static final int OpCode_MASK = 0x7800; |
41 |
|
|
42 |
|
private final String _externalName; |
43 |
|
|
44 |
|
private final int _index; |
45 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
46 |
0
|
DNSOperationCode(String name, int index) {... |
47 |
0
|
_externalName = name; |
48 |
0
|
_index = index; |
49 |
|
} |
50 |
|
|
51 |
|
|
52 |
|
|
53 |
|
|
54 |
|
@return |
55 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
56 |
0
|
public String externalName() {... |
57 |
0
|
return _externalName; |
58 |
|
} |
59 |
|
|
60 |
|
|
61 |
|
|
62 |
|
|
63 |
|
@return |
64 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
65 |
0
|
public int indexValue() {... |
66 |
0
|
return _index; |
67 |
|
} |
68 |
|
|
69 |
|
|
70 |
|
@param |
71 |
|
@return |
72 |
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
73 |
0
|
public static DNSOperationCode operationCodeForFlags(int flags) {... |
74 |
0
|
int maskedIndex = (flags & OpCode_MASK) >> 11; |
75 |
0
|
for (DNSOperationCode aCode : DNSOperationCode.values()) { |
76 |
0
|
if (aCode._index == maskedIndex) return aCode; |
77 |
|
} |
78 |
0
|
return Unassigned; |
79 |
|
} |
80 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
81 |
0
|
@Override... |
82 |
|
public String toString() { |
83 |
0
|
return this.name() + " index " + this.indexValue(); |
84 |
|
} |
85 |
|
|
86 |
|
} |