1 | package fr.sii.ogham.sms.sender.impl.cloudhopper.encoder; | |
2 | ||
3 | import com.cloudhopper.commons.charset.Charset; | |
4 | import com.cloudhopper.commons.charset.CharsetUtil; | |
5 | ||
6 | /** | |
7 | * Wrapper of {@link Charset} that tracks the name of the charset. | |
8 | * | |
9 | * @author Aurélien Baudet | |
10 | * | |
11 | */ | |
12 | public class NamedCharset { | |
13 | private final String charsetName; | |
14 | private final Charset charset; | |
15 | ||
16 | /** | |
17 | * Initializes with the name and the corresponding charset. | |
18 | * | |
19 | * @param charsetName | |
20 | * the name of the charset | |
21 | * @param charset | |
22 | * the corresponding charset | |
23 | */ | |
24 | public NamedCharset(String charsetName, Charset charset) { | |
25 | super(); | |
26 | this.charsetName = charsetName; | |
27 | this.charset = charset; | |
28 | } | |
29 | ||
30 | /** | |
31 | * @return the charset name | |
32 | */ | |
33 | public String getCharsetName() { | |
34 |
4
1. getCharsetName : replaced return value with "" for fr/sii/ogham/sms/sender/impl/cloudhopper/encoder/NamedCharset::getCharsetName → NO_COVERAGE 2. getCharsetName : replaced return value with "" for fr/sii/ogham/sms/sender/impl/cloudhopper/encoder/NamedCharset::getCharsetName → TIMED_OUT 3. getCharsetName : replaced return value with "" for fr/sii/ogham/sms/sender/impl/cloudhopper/encoder/NamedCharset::getCharsetName → KILLED 4. getCharsetName : replaced return value with "" for fr/sii/ogham/sms/sender/impl/cloudhopper/encoder/NamedCharset::getCharsetName → KILLED |
return charsetName; |
35 | } | |
36 | ||
37 | /** | |
38 | * @return the corresponding charset | |
39 | */ | |
40 | public Charset getCharset() { | |
41 |
4
1. getCharset : replaced return value with null for fr/sii/ogham/sms/sender/impl/cloudhopper/encoder/NamedCharset::getCharset → NO_COVERAGE 2. getCharset : replaced return value with null for fr/sii/ogham/sms/sender/impl/cloudhopper/encoder/NamedCharset::getCharset → TIMED_OUT 3. getCharset : replaced return value with null for fr/sii/ogham/sms/sender/impl/cloudhopper/encoder/NamedCharset::getCharset → KILLED 4. getCharset : replaced return value with null for fr/sii/ogham/sms/sender/impl/cloudhopper/encoder/NamedCharset::getCharset → KILLED |
return charset; |
42 | } | |
43 | ||
44 | /** | |
45 | * Convenient method that creates a {@link NamedCharset} from the charset | |
46 | * name. | |
47 | * | |
48 | * @param charsetName | |
49 | * the charset name | |
50 | * @return the charset name with the corresponding {@link Charset} | |
51 | */ | |
52 | public static NamedCharset from(String charsetName) { | |
53 |
4
1. from : replaced return value with null for fr/sii/ogham/sms/sender/impl/cloudhopper/encoder/NamedCharset::from → SURVIVED 2. from : replaced return value with null for fr/sii/ogham/sms/sender/impl/cloudhopper/encoder/NamedCharset::from → TIMED_OUT 3. from : replaced return value with null for fr/sii/ogham/sms/sender/impl/cloudhopper/encoder/NamedCharset::from → KILLED 4. from : replaced return value with null for fr/sii/ogham/sms/sender/impl/cloudhopper/encoder/NamedCharset::from → KILLED |
return new NamedCharset(charsetName, CharsetUtil.map(charsetName)); |
54 | } | |
55 | ||
56 | @Override | |
57 | public String toString() { | |
58 |
2
1. toString : replaced return value with "" for fr/sii/ogham/sms/sender/impl/cloudhopper/encoder/NamedCharset::toString → NO_COVERAGE 2. toString : replaced return value with "" for fr/sii/ogham/sms/sender/impl/cloudhopper/encoder/NamedCharset::toString → SURVIVED |
return charsetName + " <-> " + charset; |
59 | } | |
60 | } | |
Mutations | ||
34 |
1.1 2.2 3.3 4.4 |
|
41 |
1.1 2.2 3.3 4.4 |
|
53 |
1.1 2.2 3.3 4.4 |
|
58 |
1.1 2.2 |