| 1 | package fr.sii.ogham.testing.sms.simulator.bean; | |
| 2 | ||
| 3 | /** | |
| 4 | * This is enum of the alphabet type. | |
| 5 | * | |
| 6 | * Alphabet represents the lower 4 bits of the data_coding field in the PDU, as | |
| 7 | * specified in s5.2.19 of the SMPP v3.4 specification. | |
| 8 | * | |
| 9 | * | |
| 10 | * @author Aurélien Baudet | |
| 11 | * | |
| 12 | */ | |
| 13 | public enum Alphabet { | |
| 14 | /** | |
| 15 | * SMSC alphabet default | |
| 16 | */ | |
| 17 | ALPHA_DEFAULT((byte) 0x00), | |
| 18 | ||
| 19 | /** | |
| 20 | * IA5 (CCITT T.50)/ASCII (ANSI X3.4) | |
| 21 | */ | |
| 22 | ALPHA_IA5((byte) 0x01), | |
| 23 | ||
| 24 | /** | |
| 25 | * 8-bit binary octet unspecified coding. | |
| 26 | */ | |
| 27 | ALPHA_UNSPECIFIED_2((byte) 0x02), | |
| 28 | ||
| 29 | /** | |
| 30 | * Latin 1 (ISO-8859-1) | |
| 31 | */ | |
| 32 | ALPHA_LATIN1((byte) 0x03), | |
| 33 | ||
| 34 | /** | |
| 35 | * 8-bit binary octet unspecified coding. | |
| 36 | */ | |
| 37 | ALPHA_8_BIT((byte) 0x04), | |
| 38 | ||
| 39 | /** | |
| 40 | * JIS (X 0208-1990) | |
| 41 | */ | |
| 42 | ALPHA_JIS((byte) 0x05), | |
| 43 | ||
| 44 | /** | |
| 45 | * Cyrllic (ISO-8859-5) | |
| 46 | */ | |
| 47 | ALPHA_CYRILLIC((byte) 0x06), | |
| 48 | ||
| 49 | /** | |
| 50 | * Latin/Hebrew (ISO-8859-8) | |
| 51 | */ | |
| 52 | ALPHA_LATIN_HEBREW((byte) 0x07), | |
| 53 | ||
| 54 | /** | |
| 55 | * UCS2 alphabet coding (16-bit) | |
| 56 | */ | |
| 57 | ALPHA_UCS2((byte) 0x08), | |
| 58 | ||
| 59 | /** | |
| 60 | * Pictogram Encoding | |
| 61 | */ | |
| 62 | ALPHA_PICTOGRAM_ENCODING((byte) 0x09), | |
| 63 | ||
| 64 | /** | |
| 65 | * ISO-2022-JP (Music Codes) | |
| 66 | */ | |
| 67 | ALPHA_ISO_2022_JP_MUSIC_CODES((byte) 0x0a), | |
| 68 | ||
| 69 | /** | |
| 70 | * Unused. | |
| 71 | */ | |
| 72 | ALPHA_RESERVED_11((byte) 0x0b), | |
| 73 | ||
| 74 | /** | |
| 75 | * Unused. | |
| 76 | */ | |
| 77 | ALPHA_RESERVED_12((byte) 0x0c), | |
| 78 | ||
| 79 | /** | |
| 80 | * Extended Kanji JIS(X 0212-1990) | |
| 81 | */ | |
| 82 | ALPHA_JIS_X_0212_1990((byte) 0x0d), | |
| 83 | ||
| 84 | /** | |
| 85 | * KS C 5601 (now known as KS X 1001 but referred to by the old name in the | |
| 86 | * SMPP v3.4 spec) | |
| 87 | */ | |
| 88 | ALPHA_KS_C_5601((byte) 0x0e), | |
| 89 | ||
| 90 | /** | |
| 91 | * Unused. | |
| 92 | */ | |
| 93 | ALPHA_RESERVED_15((byte) 0x0f); | |
| 94 | ||
| 95 | private final byte value; | |
| 96 | ||
| 97 | Alphabet(byte alphabetValue) { | |
| 98 | this.value = alphabetValue; | |
| 99 | } | |
| 100 | ||
| 101 | /** | |
| 102 | * Initialize the Alphabet from the byte value | |
| 103 | * | |
| 104 | * @param alphabetValue | |
| 105 | * the alphabet value | |
| 106 | * @return the Alphabet enum | |
| 107 | */ | |
| 108 | public static Alphabet from(byte alphabetValue) { | |
| 109 | for (Alphabet alphabet : values()) { | |
| 110 |
4
1. from : negated conditional → NO_COVERAGE 2. from : negated conditional → KILLED 3. from : negated conditional → KILLED 4. from : negated conditional → KILLED |
if (alphabet.value() == alphabetValue) { |
| 111 |
4
1. from : replaced return value with null for fr/sii/ogham/testing/sms/simulator/bean/Alphabet::from → NO_COVERAGE 2. from : replaced return value with null for fr/sii/ogham/testing/sms/simulator/bean/Alphabet::from → KILLED 3. from : replaced return value with null for fr/sii/ogham/testing/sms/simulator/bean/Alphabet::from → KILLED 4. from : replaced return value with null for fr/sii/ogham/testing/sms/simulator/bean/Alphabet::from → KILLED |
return alphabet; |
| 112 | } | |
| 113 | } | |
| 114 | throw new IllegalArgumentException("No enum const Alphabet with value " + alphabetValue); | |
| 115 | } | |
| 116 | ||
| 117 | /** | |
| 118 | * The alphabet value | |
| 119 | * | |
| 120 | * @return the alphabet value | |
| 121 | */ | |
| 122 | public byte value() { | |
| 123 |
4
1. value : replaced byte return with 0 for fr/sii/ogham/testing/sms/simulator/bean/Alphabet::value → NO_COVERAGE 2. value : replaced byte return with 0 for fr/sii/ogham/testing/sms/simulator/bean/Alphabet::value → KILLED 3. value : replaced byte return with 0 for fr/sii/ogham/testing/sms/simulator/bean/Alphabet::value → KILLED 4. value : replaced byte return with 0 for fr/sii/ogham/testing/sms/simulator/bean/Alphabet::value → KILLED |
return value; |
| 124 | } | |
| 125 | } | |
Mutations | ||
| 110 |
1.1 2.2 3.3 4.4 |
|
| 111 |
1.1 2.2 3.3 4.4 |
|
| 123 |
1.1 2.2 3.3 4.4 |