1 |
|
package pl.magot.vetch.ancal; |
2 |
|
|
3 |
|
import java.util.NoSuchElementException; |
4 |
|
|
5 |
|
import pl.magot.vetch.ancal.R; |
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
|
|
| 0% |
Uncovered Elements: 17 (17) |
Complexity: 6 |
Complexity Density: 0,6 |
|
10 |
|
public enum MessageType { |
11 |
|
INFO(1, R.string.msgTypeInfo, R.drawable.msgicon_info), |
12 |
|
WARNING(2, R.string.msgTypeWarning, R.drawable.msgicon_warning), |
13 |
|
ERROR(3, R.string.msgTypeError, R.drawable.msgicon_error); |
14 |
|
|
15 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0,5 |
|
16 |
0
|
public static MessageType create(int id) {... |
17 |
0
|
for (MessageType type : values()) { |
18 |
0
|
if (type.getId() == id) { |
19 |
0
|
return type; |
20 |
|
} |
21 |
|
} |
22 |
|
|
23 |
0
|
throw new NoSuchElementException("unknown message type (id = " + id + ")!"); |
24 |
|
} |
25 |
|
|
26 |
|
private final int typeId; |
27 |
|
private final int titleId; |
28 |
|
private final int iconId; |
29 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0,33 |
|
30 |
0
|
private MessageType(int id, int title, int icon) {... |
31 |
0
|
typeId = id; |
32 |
0
|
titleId = title; |
33 |
0
|
iconId = icon; |
34 |
|
} |
35 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
36 |
0
|
public int getId() {... |
37 |
0
|
return typeId; |
38 |
|
} |
39 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
40 |
0
|
public int getTitle() {... |
41 |
0
|
return titleId; |
42 |
|
} |
43 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
44 |
0
|
public int getIcon() {... |
45 |
0
|
return iconId; |
46 |
|
} |
47 |
|
} |