1 | package fr.sii.ogham.sms.message.addressing; | |
2 | ||
3 | /** | |
4 | * TON as described in GSM 03.40. | |
5 | * | |
6 | * @author cdejonghe | |
7 | * | |
8 | */ | |
9 | public enum TypeOfNumber { | |
10 | /** Unknown = 0. */ | |
11 | UNKNOWN((byte) 0), | |
12 | /** International = 1. */ | |
13 | INTERNATIONAL((byte) 1), | |
14 | /** National = 2. */ | |
15 | NATIONAL((byte) 2), | |
16 | /** Network Specific = 3. */ | |
17 | NETWORK_SPECIFIC((byte) 3), | |
18 | /** Subscriber Number = 4. */ | |
19 | SUBSCRIBER((byte) 4), | |
20 | /** Alphanumeric = 5. */ | |
21 | ALPHANUMERIC((byte) 5), | |
22 | /** Abbreviated = 6. */ | |
23 | ABBREVIATED((byte) 6); | |
24 | ||
25 | private byte value; | |
26 | ||
27 | TypeOfNumber(byte value) { | |
28 | this.value = value; | |
29 | } | |
30 | ||
31 | /** | |
32 | * Get the byte value of the enum constant. | |
33 | * | |
34 | * @return the byte value. | |
35 | */ | |
36 | public byte value() { | |
37 |
4
1. value : replaced byte return with 0 for fr/sii/ogham/sms/message/addressing/TypeOfNumber::value → NO_COVERAGE 2. value : replaced byte return with 0 for fr/sii/ogham/sms/message/addressing/TypeOfNumber::value → SURVIVED 3. value : replaced byte return with 0 for fr/sii/ogham/sms/message/addressing/TypeOfNumber::value → TIMED_OUT 4. value : replaced byte return with 0 for fr/sii/ogham/sms/message/addressing/TypeOfNumber::value → KILLED |
return value; |
38 | } | |
39 | ||
40 | /** | |
41 | * Get the TypeOfNumber based on the specified byte value | |
42 | * representation. | |
43 | * | |
44 | * @param value | |
45 | * is the int / binary value representation. | |
46 | * @return is the enum const related to the specified int value. | |
47 | * @throws IllegalArgumentException | |
48 | * if there is no enum const associated with specified int | |
49 | * value. | |
50 | */ | |
51 | public static TypeOfNumber valueOf(byte value) { | |
52 | for (TypeOfNumber current : values()) { | |
53 |
1
1. valueOf : negated conditional → NO_COVERAGE |
if (current.value == value) { |
54 |
1
1. valueOf : replaced return value with null for fr/sii/ogham/sms/message/addressing/TypeOfNumber::valueOf → NO_COVERAGE |
return current; |
55 | } | |
56 | } | |
57 | throw new IllegalArgumentException("Invalid value for TypeOfNumber : " + value); | |
58 | } | |
59 | } | |
Mutations | ||
37 |
1.1 2.2 3.3 4.4 |
|
53 |
1.1 |
|
54 |
1.1 |