1 | package fr.sii.ogham.sms.builder.cloudhopper; | |
2 | ||
3 | import static com.cloudhopper.commons.charset.CharsetUtil.NAME_GSM; | |
4 | import static com.cloudhopper.commons.charset.CharsetUtil.NAME_GSM7; | |
5 | import static com.cloudhopper.commons.charset.CharsetUtil.NAME_ISO_8859_1; | |
6 | import static com.cloudhopper.commons.charset.CharsetUtil.NAME_UCS_2; | |
7 | ||
8 | import com.cloudhopper.commons.charset.Charset; | |
9 | import com.cloudhopper.commons.charset.CharsetUtil; | |
10 | ||
11 | import fr.sii.ogham.core.builder.Builder; | |
12 | import fr.sii.ogham.core.builder.configuration.ConfigurationValueBuilder; | |
13 | import fr.sii.ogham.core.builder.configuration.ConfigurationValueBuilderHelper; | |
14 | import fr.sii.ogham.core.builder.configurer.Configurer; | |
15 | import fr.sii.ogham.core.builder.context.BuildContext; | |
16 | import fr.sii.ogham.core.builder.env.EnvironmentBuilder; | |
17 | import fr.sii.ogham.core.fluent.AbstractParent; | |
18 | import fr.sii.ogham.core.util.PriorizedList; | |
19 | import fr.sii.ogham.sms.encoder.Encoder; | |
20 | import fr.sii.ogham.sms.encoder.SupportingEncoder; | |
21 | import fr.sii.ogham.sms.exception.message.EncodingException; | |
22 | import fr.sii.ogham.sms.sender.impl.cloudhopper.encoder.CloudhopperCharsetSupportingEncoder; | |
23 | import fr.sii.ogham.sms.sender.impl.cloudhopper.encoder.GuessEncodingEncoder; | |
24 | import fr.sii.ogham.sms.sender.impl.cloudhopper.encoder.NamedCharset; | |
25 | ||
26 | /** | |
27 | * Configures text message encoding: | |
28 | * | |
29 | * It supports <a href="https://en.wikipedia.org/wiki/GSM_03.38">GSM 03.38</a> | |
30 | * standard encodings. It automatically guess the best supported encoding in | |
31 | * order to use the minimum octets: | |
32 | * <ul> | |
33 | * <li>It encodes using GSM 7-bit default alphabet if the message contains only | |
34 | * characters defined in the table. Message is packed so the message can have a | |
35 | * maximum length of 160 characters. This is enable only if automatic guessing | |
36 | * is enabled (using {@link #autoGuess(Boolean)}) and GSM 7-bit is enabled | |
37 | * (using {@link #gsm7bitPacked(Integer)}).</li> | |
38 | * <li>It encodes using GSM 8-bit data encoding if the message contains only | |
39 | * characters that can be encoded on one octet. This is enable only if automatic | |
40 | * guessing is enabled (using {@link #autoGuess(Boolean)}) and GSM 8-bit is | |
41 | * enabled (using {@link #gsm8bit(Integer)}).</li> | |
42 | * <li>It encodes using Latin 1 (ISO-8859-1) data encoding if the message | |
43 | * contains only characters that can be encoded on one octet. This is enable | |
44 | * only if automatic guessing is enabled (using {@link #autoGuess(Boolean)}) and | |
45 | * Latin-1 is enabled (using {@link #latin1(Integer)}).</li> | |
46 | * <li>It encodes using UCS-2 encoding if the message contains special | |
47 | * characters that can't be encoded on one octet. Each character is encoded on | |
48 | * two octets. This is enable only if automatic guessing is enabled (using | |
49 | * {@link #autoGuess(Boolean)}) and UCS-2 is enabled (using | |
50 | * {@link #ucs2(Integer)}).</li> | |
51 | * </ul> | |
52 | * | |
53 | * <strong>Automatic guessing enabled</strong> | |
54 | * <p> | |
55 | * Standard encodings are registered with a priority. The priority is used when | |
56 | * auto-guessing is enabled. Each registered encoding is tested against the text | |
57 | * message starting with the encoding with the highest priority. | |
58 | * </p> | |
59 | * | |
60 | * <p> | |
61 | * If a priority is set to 0 (or negative number), the encoding is disabled. | |
62 | * </p> | |
63 | * | |
64 | * <p> | |
65 | * Any registered custom encoder is added into the guessing list according to | |
66 | * its priority. Use a the highest value to use custom encoder first. To know | |
67 | * default priority values for encodings, see | |
68 | * {@link DefaultCloudhopperConfigurer}. | |
69 | * </p> | |
70 | * | |
71 | * <strong>Automatic guessing disabled</strong> | |
72 | * <p> | |
73 | * Standard encodings are not registered at all. | |
74 | * </p> | |
75 | * | |
76 | * <p> | |
77 | * If custom encoders are registered then only those encoders are used. | |
78 | * </p> | |
79 | * | |
80 | * <p> | |
81 | * If no custom encoders are registered, then default charset encoding is used | |
82 | * (see {@link #fallback(String)}). | |
83 | * </p> | |
84 | * | |
85 | * | |
86 | * @author Aurélien Baudet | |
87 | * | |
88 | */ | |
89 | public class EncoderBuilder extends AbstractParent<CloudhopperBuilder> implements Builder<Encoder> { | |
90 | protected final BuildContext buildContext; | |
91 | protected final StandardEncodingHelper gsm7PackedValueBuilder; | |
92 | protected final StandardEncodingHelper gsm8ValueBuilder; | |
93 | protected final StandardEncodingHelper ucs2ValueBuilder; | |
94 | protected final StandardEncodingHelper latin1ValueBuilder; | |
95 | protected final PriorizedList<Encoder> customEncoders; | |
96 | protected final ConfigurationValueBuilderHelper<EncoderBuilder, Boolean> autoGuessValueBuilder; | |
97 | protected final ConfigurationValueBuilderHelper<EncoderBuilder, String> fallbackCharsetNameValueBuilder; | |
98 | ||
99 | /** | |
100 | * Initializes the builder with a parent builder. The parent builder is used | |
101 | * when calling {@link #and()} method. The {@link EnvironmentBuilder} is | |
102 | * used to evaluate properties when {@link #build()} method is called. | |
103 | * | |
104 | * @param parent | |
105 | * the parent builder | |
106 | * @param buildContext | |
107 | * for registering instances and property evaluation | |
108 | */ | |
109 | public EncoderBuilder(CloudhopperBuilder parent, BuildContext buildContext) { | |
110 | super(parent); | |
111 | this.buildContext = buildContext; | |
112 |
5
1. lambda$new$0 : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::lambda$new$0 → KILLED 2. lambda$new$0 : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::lambda$new$0 → KILLED 3. lambda$new$0 : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::lambda$new$0 → KILLED 4. lambda$new$0 : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::lambda$new$0 → KILLED 5. lambda$new$0 : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::lambda$new$0 → KILLED |
gsm7PackedValueBuilder = buildContext.newConfigurationValueBuilder(ctx -> new StandardEncodingHelper(this, NAME_GSM7, ctx)); |
113 |
5
1. lambda$new$1 : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::lambda$new$1 → KILLED 2. lambda$new$1 : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::lambda$new$1 → KILLED 3. lambda$new$1 : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::lambda$new$1 → KILLED 4. lambda$new$1 : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::lambda$new$1 → KILLED 5. lambda$new$1 : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::lambda$new$1 → KILLED |
gsm8ValueBuilder = buildContext.newConfigurationValueBuilder(ctx -> new StandardEncodingHelper(this, NAME_GSM, ctx)); |
114 |
5
1. lambda$new$2 : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::lambda$new$2 → KILLED 2. lambda$new$2 : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::lambda$new$2 → KILLED 3. lambda$new$2 : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::lambda$new$2 → KILLED 4. lambda$new$2 : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::lambda$new$2 → KILLED 5. lambda$new$2 : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::lambda$new$2 → KILLED |
ucs2ValueBuilder = buildContext.newConfigurationValueBuilder(ctx -> new StandardEncodingHelper(this, NAME_UCS_2, ctx)); |
115 |
5
1. lambda$new$3 : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::lambda$new$3 → KILLED 2. lambda$new$3 : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::lambda$new$3 → KILLED 3. lambda$new$3 : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::lambda$new$3 → KILLED 4. lambda$new$3 : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::lambda$new$3 → KILLED 5. lambda$new$3 : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::lambda$new$3 → KILLED |
latin1ValueBuilder = buildContext.newConfigurationValueBuilder(ctx -> new StandardEncodingHelper(this, NAME_ISO_8859_1, ctx)); |
116 | customEncoders = new PriorizedList<>(); | |
117 | autoGuessValueBuilder = buildContext.newConfigurationValueBuilder(this, Boolean.class); | |
118 | fallbackCharsetNameValueBuilder = buildContext.newConfigurationValueBuilder(this, String.class); | |
119 | } | |
120 | ||
121 | /** | |
122 | * Set priority for encoding text messages using GSM 7-bit encoding. GSM | |
123 | * 7-bit encoding and GSM 8-bit encoding use the same character tables. Only | |
124 | * 7 bits are necessary to represents characters. In GSM 8-bit encoding a | |
125 | * leading 0 is added. However, GSM 7-bit encoding is packed. Every | |
126 | * character is "merged" with the next one in order to use more characters | |
127 | * for the same number of octets. | |
128 | * | |
129 | * <p> | |
130 | * If priority value is 0 or negative, it disables GSM 7-bit encoding. | |
131 | * | |
132 | * <p> | |
133 | * The value set using this method takes precedence over any property and | |
134 | * default value configured using {@link #gsm7bitPacked()}. | |
135 | * | |
136 | * <pre> | |
137 | * .gsm7bitPacked(10) | |
138 | * .gsm7bitPacked() | |
139 | * .properties("${custom.property.high-priority}", "${custom.property.low-priority}") | |
140 | * .defaultValue(0) | |
141 | * </pre> | |
142 | * | |
143 | * <pre> | |
144 | * .gsm7bitPacked(10) | |
145 | * .gsm7bitPacked() | |
146 | * .properties("${custom.property.high-priority}", "${custom.property.low-priority}") | |
147 | * .defaultValue(0) | |
148 | * </pre> | |
149 | * | |
150 | * In both cases, {@code gsm7bitPacked(10)} is used. | |
151 | * | |
152 | * <p> | |
153 | * If this method is called several times, only the last value is used. | |
154 | * | |
155 | * <p> | |
156 | * If {@code null} value is set, it is like not setting a value at all. The | |
157 | * property/default value configuration is applied. | |
158 | * | |
159 | * @param priority | |
160 | * the priority (highest value means that GSM 7-bit encoding is | |
161 | * tried first) | |
162 | * @return this instance for fluent chaining | |
163 | */ | |
164 | public EncoderBuilder gsm7bitPacked(Integer priority) { | |
165 |
2
1. gsm7bitPacked : removed call to fr/sii/ogham/sms/builder/cloudhopper/StandardEncodingHelper::setValue → NO_COVERAGE 2. gsm7bitPacked : removed call to fr/sii/ogham/sms/builder/cloudhopper/StandardEncodingHelper::setValue → KILLED |
gsm7PackedValueBuilder.setValue(priority); |
166 |
2
1. gsm7bitPacked : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::gsm7bitPacked → NO_COVERAGE 2. gsm7bitPacked : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::gsm7bitPacked → KILLED |
return this; |
167 | } | |
168 | ||
169 | /** | |
170 | * Set priority for encoding text messages using GSM 7-bit encoding. GSM | |
171 | * 7-bit encoding and GSM 8-bit encoding use the same character tables. Only | |
172 | * 7 bits are necessary to represents characters. In GSM 8-bit encoding a | |
173 | * leading 0 is added. However, GSM 7-bit encoding is packed. Every | |
174 | * character is "merged" with the next one in order to use more characters | |
175 | * for the same number of octets. | |
176 | * | |
177 | * <p> | |
178 | * If priority value is 0 or negative, it disables GSM 7-bit encoding. | |
179 | * | |
180 | * <p> | |
181 | * This method is mainly used by {@link Configurer}s to register some | |
182 | * property keys and/or a default value. The aim is to let developer be able | |
183 | * to externalize its configuration (using system properties, configuration | |
184 | * file or anything else). If the developer doesn't configure any value for | |
185 | * the registered properties, the default value is used (if set). | |
186 | * | |
187 | * <pre> | |
188 | * .gsm7bitPacked() | |
189 | * .properties("${custom.property.high-priority}", "${custom.property.low-priority}") | |
190 | * .defaultValue(0) | |
191 | * </pre> | |
192 | * | |
193 | * <p> | |
194 | * Non-null value set using {@link #gsm7bitPacked(Integer)} takes precedence | |
195 | * over property values and default value. | |
196 | * | |
197 | * <pre> | |
198 | * .gsm7bitPacked(10) | |
199 | * .gsm7bitPacked() | |
200 | * .properties("${custom.property.high-priority}", "${custom.property.low-priority}") | |
201 | * .defaultValue(0) | |
202 | * </pre> | |
203 | * | |
204 | * The value {@code 10} is used regardless of the value of the properties | |
205 | * and default value. | |
206 | * | |
207 | * <p> | |
208 | * See {@link ConfigurationValueBuilder} for more information. | |
209 | * | |
210 | * | |
211 | * @return the builder to configure property keys/default value | |
212 | */ | |
213 | public ConfigurationValueBuilder<EncoderBuilder, Integer> gsm7bitPacked() { | |
214 |
5
1. gsm7bitPacked : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::gsm7bitPacked → KILLED 2. gsm7bitPacked : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::gsm7bitPacked → KILLED 3. gsm7bitPacked : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::gsm7bitPacked → KILLED 4. gsm7bitPacked : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::gsm7bitPacked → KILLED 5. gsm7bitPacked : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::gsm7bitPacked → KILLED |
return gsm7PackedValueBuilder; |
215 | } | |
216 | ||
217 | /** | |
218 | * Set priority for encoding text messages using GSM 8-bit encoding. GSM | |
219 | * 7-bit encoding and GSM 8-bit encoding use the same character tables. Only | |
220 | * 7 bits are necessary to represents characters. In GSM 8-bit encoding a | |
221 | * leading 0 is added. | |
222 | * | |
223 | * <p> | |
224 | * If priority value is 0 or negative, it disables GSM 8-bit encoding. | |
225 | * | |
226 | * <p> | |
227 | * The value set using this method takes precedence over any property and | |
228 | * default value configured using {@link #gsm8bit()}. | |
229 | * | |
230 | * <pre> | |
231 | * .gsm8bit(10) | |
232 | * .gsm8bit() | |
233 | * .properties("${custom.property.high-priority}", "${custom.property.low-priority}") | |
234 | * .defaultValue(5) | |
235 | * </pre> | |
236 | * | |
237 | * <pre> | |
238 | * .gsm8bit(10) | |
239 | * .gsm8bit() | |
240 | * .properties("${custom.property.high-priority}", "${custom.property.low-priority}") | |
241 | * .defaultValue(5) | |
242 | * </pre> | |
243 | * | |
244 | * In both cases, {@code gsm8bit(10)} is used. | |
245 | * | |
246 | * <p> | |
247 | * If this method is called several times, only the last value is used. | |
248 | * | |
249 | * <p> | |
250 | * If {@code null} value is set, it is like not setting a value at all. The | |
251 | * property/default value configuration is applied. | |
252 | * | |
253 | * @param priority | |
254 | * the priority (highest value means that GSM 8-bit encoding is | |
255 | * tried first) | |
256 | * @return this instance for fluent chaining | |
257 | */ | |
258 | public EncoderBuilder gsm8bit(Integer priority) { | |
259 |
2
1. gsm8bit : removed call to fr/sii/ogham/sms/builder/cloudhopper/StandardEncodingHelper::setValue → NO_COVERAGE 2. gsm8bit : removed call to fr/sii/ogham/sms/builder/cloudhopper/StandardEncodingHelper::setValue → KILLED |
gsm8ValueBuilder.setValue(priority); |
260 |
2
1. gsm8bit : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::gsm8bit → NO_COVERAGE 2. gsm8bit : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::gsm8bit → KILLED |
return this; |
261 | } | |
262 | ||
263 | /** | |
264 | * Set priority for encoding text messages using GSM 8-bit encoding. GSM | |
265 | * 7-bit encoding and GSM 8-bit encoding use the same character tables. Only | |
266 | * 7 bits are necessary to represents characters. In GSM 8-bit encoding a | |
267 | * leading 0 is added. | |
268 | * | |
269 | * <p> | |
270 | * If priority value is 0 or negative, it disables GSM 8-bit encoding. | |
271 | * | |
272 | * <p> | |
273 | * This method is mainly used by {@link Configurer}s to register some | |
274 | * property keys and/or a default value. The aim is to let developer be able | |
275 | * to externalize its configuration (using system properties, configuration | |
276 | * file or anything else). If the developer doesn't configure any value for | |
277 | * the registered properties, the default value is used (if set). | |
278 | * | |
279 | * <pre> | |
280 | * .gsm8bit() | |
281 | * .properties("${custom.property.high-priority}", "${custom.property.low-priority}") | |
282 | * .defaultValue(5) | |
283 | * </pre> | |
284 | * | |
285 | * <p> | |
286 | * Non-null value set using {@link #gsm8bit(Integer)} takes precedence over | |
287 | * property values and default value. | |
288 | * | |
289 | * <pre> | |
290 | * .gsm8bit(10) | |
291 | * .gsm8bit() | |
292 | * .properties("${custom.property.high-priority}", "${custom.property.low-priority}") | |
293 | * .defaultValue(5) | |
294 | * </pre> | |
295 | * | |
296 | * The value {@code 10} is used regardless of the value of the properties | |
297 | * and default value. | |
298 | * | |
299 | * <p> | |
300 | * See {@link ConfigurationValueBuilder} for more information. | |
301 | * | |
302 | * | |
303 | * @return the builder to configure property keys/default value | |
304 | */ | |
305 | public ConfigurationValueBuilder<EncoderBuilder, Integer> gsm8bit() { | |
306 |
5
1. gsm8bit : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::gsm8bit → KILLED 2. gsm8bit : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::gsm8bit → KILLED 3. gsm8bit : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::gsm8bit → KILLED 4. gsm8bit : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::gsm8bit → KILLED 5. gsm8bit : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::gsm8bit → KILLED |
return gsm8ValueBuilder; |
307 | } | |
308 | ||
309 | /** | |
310 | * Set priority for encoding text messages using UCS-2. UCS-2 uses two | |
311 | * octets per character. | |
312 | * | |
313 | * <p> | |
314 | * If priority value is 0 or negative, it disables UCS-2 encoding. | |
315 | * | |
316 | * <p> | |
317 | * The value set using this method takes precedence over any property and | |
318 | * default value configured using {@link #ucs2()}. | |
319 | * | |
320 | * <pre> | |
321 | * .ucs2(10) | |
322 | * .ucs2() | |
323 | * .properties("${custom.property.high-priority}", "${custom.property.low-priority}") | |
324 | * .defaultValue(2) | |
325 | * </pre> | |
326 | * | |
327 | * <pre> | |
328 | * .ucs2(10) | |
329 | * .ucs2() | |
330 | * .properties("${custom.property.high-priority}", "${custom.property.low-priority}") | |
331 | * .defaultValue(2) | |
332 | * </pre> | |
333 | * | |
334 | * In both cases, {@code ucs2(10)} is used. | |
335 | * | |
336 | * <p> | |
337 | * If this method is called several times, only the last value is used. | |
338 | * | |
339 | * <p> | |
340 | * If {@code null} value is set, it is like not setting a value at all. The | |
341 | * property/default value configuration is applied. | |
342 | * | |
343 | * @param priority | |
344 | * the priority (highest value means that UCS-2 encoding is tried | |
345 | * first) | |
346 | * @return this instance for fluent chaining | |
347 | */ | |
348 | public EncoderBuilder ucs2(Integer priority) { | |
349 |
2
1. ucs2 : removed call to fr/sii/ogham/sms/builder/cloudhopper/StandardEncodingHelper::setValue → NO_COVERAGE 2. ucs2 : removed call to fr/sii/ogham/sms/builder/cloudhopper/StandardEncodingHelper::setValue → KILLED |
ucs2ValueBuilder.setValue(priority); |
350 |
2
1. ucs2 : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::ucs2 → NO_COVERAGE 2. ucs2 : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::ucs2 → KILLED |
return this; |
351 | } | |
352 | ||
353 | /** | |
354 | * Set priority for encoding text messages using UCS-2. UCS-2 uses two | |
355 | * octets per character. | |
356 | * | |
357 | * <p> | |
358 | * If priority value is 0 or negative, it disables UCS-2 encoding. | |
359 | * | |
360 | * <p> | |
361 | * This method is mainly used by {@link Configurer}s to register some | |
362 | * property keys and/or a default value. The aim is to let developer be able | |
363 | * to externalize its configuration (using system properties, configuration | |
364 | * file or anything else). If the developer doesn't configure any value for | |
365 | * the registered properties, the default value is used (if set). | |
366 | * | |
367 | * <pre> | |
368 | * .ucs2() | |
369 | * .properties("${custom.property.high-priority}", "${custom.property.low-priority}") | |
370 | * .defaultValue(2) | |
371 | * </pre> | |
372 | * | |
373 | * <p> | |
374 | * Non-null value set using {@link #ucs2(Integer)} takes precedence over | |
375 | * property values and default value. | |
376 | * | |
377 | * <pre> | |
378 | * .ucs2(10) | |
379 | * .ucs2() | |
380 | * .properties("${custom.property.high-priority}", "${custom.property.low-priority}") | |
381 | * .defaultValue(2) | |
382 | * </pre> | |
383 | * | |
384 | * The value {@code 10} is used regardless of the value of the properties | |
385 | * and default value. | |
386 | * | |
387 | * <p> | |
388 | * See {@link ConfigurationValueBuilder} for more information. | |
389 | * | |
390 | * | |
391 | * @return the builder to configure property keys/default value | |
392 | */ | |
393 | public ConfigurationValueBuilder<EncoderBuilder, Integer> ucs2() { | |
394 |
5
1. ucs2 : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::ucs2 → KILLED 2. ucs2 : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::ucs2 → KILLED 3. ucs2 : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::ucs2 → KILLED 4. ucs2 : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::ucs2 → KILLED 5. ucs2 : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::ucs2 → KILLED |
return ucs2ValueBuilder; |
395 | } | |
396 | ||
397 | /** | |
398 | * Set priority for encoding text messages using Latin-1 (ISO-8859-1). | |
399 | * | |
400 | * <p> | |
401 | * If priority value is 0 or negative, it disables Latin-1 encoding. | |
402 | * | |
403 | * <p> | |
404 | * The value set using this method takes precedence over any property and | |
405 | * default value configured using {@link #latin1()}. | |
406 | * | |
407 | * <pre> | |
408 | * .latin1(10) | |
409 | * .latin1() | |
410 | * .properties("${custom.property.high-priority}", "${custom.property.low-priority}") | |
411 | * .defaultValue(4) | |
412 | * </pre> | |
413 | * | |
414 | * <pre> | |
415 | * .latin1(10) | |
416 | * .latin1() | |
417 | * .properties("${custom.property.high-priority}", "${custom.property.low-priority}") | |
418 | * .defaultValue(4) | |
419 | * </pre> | |
420 | * | |
421 | * In both cases, {@code latin1(10)} is used. | |
422 | * | |
423 | * <p> | |
424 | * If this method is called several times, only the last value is used. | |
425 | * | |
426 | * <p> | |
427 | * If {@code null} value is set, it is like not setting a value at all. The | |
428 | * property/default value configuration is applied. | |
429 | * | |
430 | * @param priority | |
431 | * the priority (highest value means that Latin-1 encoding is | |
432 | * tried first) | |
433 | * @return this instance for fluent chaining | |
434 | */ | |
435 | public EncoderBuilder latin1(Integer priority) { | |
436 |
1
1. latin1 : removed call to fr/sii/ogham/sms/builder/cloudhopper/StandardEncodingHelper::setValue → NO_COVERAGE |
latin1ValueBuilder.setValue(priority); |
437 |
1
1. latin1 : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::latin1 → NO_COVERAGE |
return this; |
438 | } | |
439 | ||
440 | /** | |
441 | * Set priority for encoding text messages using Latin-1 (ISO-8859-1). | |
442 | * | |
443 | * <p> | |
444 | * If priority value is 0 or negative, it disables Latin-1 encoding. | |
445 | * | |
446 | * <p> | |
447 | * This method is mainly used by {@link Configurer}s to register some | |
448 | * property keys and/or a default value. The aim is to let developer be able | |
449 | * to externalize its configuration (using system properties, configuration | |
450 | * file or anything else). If the developer doesn't configure any value for | |
451 | * the registered properties, the default value is used (if set). | |
452 | * | |
453 | * <pre> | |
454 | * .latin1() | |
455 | * .properties("${custom.property.high-priority}", "${custom.property.low-priority}") | |
456 | * .defaultValue(4) | |
457 | * </pre> | |
458 | * | |
459 | * <p> | |
460 | * Non-null value set using {@link #latin1(Integer)} takes precedence over | |
461 | * property values and default value. | |
462 | * | |
463 | * <pre> | |
464 | * .latin1(10) | |
465 | * .latin1() | |
466 | * .properties("${custom.property.high-priority}", "${custom.property.low-priority}") | |
467 | * .defaultValue(4) | |
468 | * </pre> | |
469 | * | |
470 | * The value {@code 10} is used regardless of the value of the properties | |
471 | * and default value. | |
472 | * | |
473 | * <p> | |
474 | * See {@link ConfigurationValueBuilder} for more information. | |
475 | * | |
476 | * | |
477 | * @return the builder to configure property keys/default value | |
478 | */ | |
479 | public ConfigurationValueBuilder<EncoderBuilder, Integer> latin1() { | |
480 |
5
1. latin1 : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::latin1 → KILLED 2. latin1 : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::latin1 → KILLED 3. latin1 : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::latin1 → KILLED 4. latin1 : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::latin1 → KILLED 5. latin1 : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::latin1 → KILLED |
return latin1ValueBuilder; |
481 | } | |
482 | ||
483 | /** | |
484 | * Register a custom {@link Encoder} with associated priority. | |
485 | * | |
486 | * <p> | |
487 | * The encoder is registered like standard encoders (see | |
488 | * {@link #gsm7bitPacked(Integer)}, {@link #gsm8bit(Integer)}, | |
489 | * {@link #latin1(Integer)}, {@link #ucs2(Integer)}). | |
490 | * | |
491 | * <p> | |
492 | * If automatic guessing is enabled (see {@link #autoGuess(Boolean)}), the | |
493 | * registered encoder is also used in automatic guessing (according to | |
494 | * priorities). | |
495 | * | |
496 | * <p> | |
497 | * If automatic guessing is disabled, only custom {@link Encoder}(s) that | |
498 | * are registered using this method are used. They are executed according to | |
499 | * priority order (highest priority is executed first). If encoder fails to | |
500 | * encode (throws {@link EncodingException}) then the next one is tried. The | |
501 | * registered encoder can also implement {@link SupportingEncoder} interface | |
502 | * to indicate if the encoder is able to encode or not the text. | |
503 | * | |
504 | * <p> | |
505 | * If priority is set to 0 (or negative number), the associated encoder is | |
506 | * disabled. | |
507 | * | |
508 | * @param encoder | |
509 | * the encoder to register | |
510 | * @param priority | |
511 | * the associated priority (the highest priority is executed | |
512 | * first) | |
513 | * @return this instance for fluent chaining | |
514 | */ | |
515 | public EncoderBuilder register(Encoder encoder, int priority) { | |
516 | customEncoders.register(encoder, priority); | |
517 |
1
1. register : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::register → NO_COVERAGE |
return this; |
518 | } | |
519 | ||
520 | /** | |
521 | * Enable/disable automatic guessing of message encoding. | |
522 | * | |
523 | * <p> | |
524 | * If enables, it automatically guess the best supported encoding in order | |
525 | * to use the minimum octets: | |
526 | * <ul> | |
527 | * <li>It encodes using GSM 7-bit default alphabet if the message contains | |
528 | * only characters defined in the table. Message is packed so the message | |
529 | * can have a maximum length of 160 characters. This is enable only if | |
530 | * automatic guessing is enabled (using {@link #autoGuess(Boolean)}) and GSM | |
531 | * 7-bit is enabled (using {@link #gsm7bitPacked(Integer)}).</li> | |
532 | * <li>It encodes using GSM 8-bit data encoding if the message contains only | |
533 | * characters that can be encoded on one octet. This is enable only if | |
534 | * automatic guessing is enabled (using {@link #autoGuess(Boolean)} and GSM | |
535 | * 8-bit is enabled (using {@link #gsm8bit(Integer)}).</li> | |
536 | * <li>It encodes using Latin 1 (ISO-8859-1) data encoding if the message | |
537 | * contains only characters that can be encoded on one octet. This is enable | |
538 | * only if automatic guessing is enabled (using {@link #autoGuess(Boolean)} | |
539 | * and GSM 8-bit is enabled (using {@link #latin1(Integer)}).</li> | |
540 | * <li>It encodes using UCS-2 encoding if the message contains special | |
541 | * characters that can't be encoded on one octet. Each character is encoded | |
542 | * on two octets. This is enable only if automatic guessing is enabled | |
543 | * (using {@link #autoGuess(Boolean)}) and UCS-2 is enabled (using | |
544 | * {@link #ucs2(Integer)}).</li> | |
545 | * </ul> | |
546 | * | |
547 | * <p> | |
548 | * The value set using this method takes precedence over any property and | |
549 | * default value configured using {@link #autoGuess()}. | |
550 | * | |
551 | * <pre> | |
552 | * .autoGuess(false) | |
553 | * .autoGuess() | |
554 | * .properties("${custom.property.high-priority}", "${custom.property.low-priority}") | |
555 | * .defaultValue(true) | |
556 | * </pre> | |
557 | * | |
558 | * <pre> | |
559 | * .autoGuess(false) | |
560 | * .autoGuess() | |
561 | * .properties("${custom.property.high-priority}", "${custom.property.low-priority}") | |
562 | * .defaultValue(true) | |
563 | * </pre> | |
564 | * | |
565 | * In both cases, {@code autoGuess(false)} is used. | |
566 | * | |
567 | * <p> | |
568 | * If this method is called several times, only the last value is used. | |
569 | * | |
570 | * <p> | |
571 | * If {@code null} value is set, it is like not setting a value at all. The | |
572 | * property/default value configuration is applied. | |
573 | * | |
574 | * @param enable | |
575 | * enable or disable automatic guessing of encoding | |
576 | * @return this instance for fluent chaining | |
577 | */ | |
578 | public EncoderBuilder autoGuess(Boolean enable) { | |
579 |
2
1. autoGuess : removed call to fr/sii/ogham/core/builder/configuration/ConfigurationValueBuilderHelper::setValue → NO_COVERAGE 2. autoGuess : removed call to fr/sii/ogham/core/builder/configuration/ConfigurationValueBuilderHelper::setValue → KILLED |
autoGuessValueBuilder.setValue(enable); |
580 |
2
1. autoGuess : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::autoGuess → NO_COVERAGE 2. autoGuess : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::autoGuess → KILLED |
return this; |
581 | } | |
582 | ||
583 | /** | |
584 | * Enable/disable automatic guessing of message encoding. | |
585 | * | |
586 | * <p> | |
587 | * If enabled, it automatically guess the best supported encoding in order | |
588 | * to use the minimum octets: | |
589 | * <ul> | |
590 | * <li>It encodes using GSM 7-bit default alphabet if the message contains | |
591 | * only characters defined in the table. Message is packed so the message | |
592 | * can have a maximum length of 160 characters. This is enabled only if | |
593 | * automatic guessing is enabled (using {@link #autoGuess(Boolean)}) and GSM | |
594 | * 7-bit is enabled (using {@link #gsm7bitPacked(Integer)}).</li> | |
595 | * <li>It encodes using GSM 8-bit data encoding if the message contains only | |
596 | * characters that can be encoded on one octet. This is enabled only if | |
597 | * automatic guessing is enabled (using {@link #autoGuess(Boolean)} and GSM | |
598 | * 8-bit is enabled (using {@link #gsm8bit(Integer)}).</li> | |
599 | * <li>It encodes using Latin 1 (ISO-8859-1) data encoding if the message | |
600 | * contains only characters that can be encoded on one octet. This is | |
601 | * enabled only if automatic guessing is enabled (using | |
602 | * {@link #autoGuess(Boolean)} and Latin-1 is enabled (using | |
603 | * {@link #latin1(Integer)}).</li> | |
604 | * <li>It encodes using UCS-2 encoding if the message contains special | |
605 | * characters that can't be encoded on one octet. Each character is encoded | |
606 | * on two octets. This is enabled only if automatic guessing is enabled | |
607 | * (using {@link #autoGuess(Boolean)}) and UCS-2 is enabled (using | |
608 | * {@link #ucs2(Integer)}).</li> | |
609 | * </ul> | |
610 | * | |
611 | * <p> | |
612 | * This method is mainly used by {@link Configurer}s to register some | |
613 | * property keys and/or a default value. The aim is to let developer be able | |
614 | * to externalize its configuration (using system properties, configuration | |
615 | * file or anything else). If the developer doesn't configure any value for | |
616 | * the registered properties, the default value is used (if set). | |
617 | * | |
618 | * <pre> | |
619 | * .autoGuess() | |
620 | * .properties("${custom.property.high-priority}", "${custom.property.low-priority}") | |
621 | * .defaultValue(true) | |
622 | * </pre> | |
623 | * | |
624 | * <p> | |
625 | * Non-null value set using {@link #autoGuess(Boolean)} takes precedence | |
626 | * over property values and default value. | |
627 | * | |
628 | * <pre> | |
629 | * .autoGuess(false) | |
630 | * .autoGuess() | |
631 | * .properties("${custom.property.high-priority}", "${custom.property.low-priority}") | |
632 | * .defaultValue(true) | |
633 | * </pre> | |
634 | * | |
635 | * The value {@code false} is used regardless of the value of the properties | |
636 | * and default value. | |
637 | * | |
638 | * <p> | |
639 | * See {@link ConfigurationValueBuilder} for more information. | |
640 | * | |
641 | * | |
642 | * @return the builder to configure property keys/default value | |
643 | */ | |
644 | public ConfigurationValueBuilder<EncoderBuilder, Boolean> autoGuess() { | |
645 |
5
1. autoGuess : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::autoGuess → KILLED 2. autoGuess : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::autoGuess → KILLED 3. autoGuess : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::autoGuess → KILLED 4. autoGuess : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::autoGuess → KILLED 5. autoGuess : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::autoGuess → KILLED |
return autoGuessValueBuilder; |
646 | } | |
647 | ||
648 | /** | |
649 | * Set which Cloudhopper {@link Charset} should be used if nothing else is | |
650 | * configured. | |
651 | * | |
652 | * <p> | |
653 | * The value set using this method takes precedence over any property and | |
654 | * default value configured using {@link #fallback()}. | |
655 | * | |
656 | * <pre> | |
657 | * .fallback(CharsetUtil.NAME_GSM8) | |
658 | * .fallback() | |
659 | * .properties("${custom.property.high-priority}", "${custom.property.low-priority}") | |
660 | * .defaultValue(CharsetUtil.NAME_GSM) | |
661 | * </pre> | |
662 | * | |
663 | * <pre> | |
664 | * .fallback(CharsetUtil.NAME_GSM8) | |
665 | * .fallback() | |
666 | * .properties("${custom.property.high-priority}", "${custom.property.low-priority}") | |
667 | * .defaultValue(CharsetUtil.NAME_GSM) | |
668 | * </pre> | |
669 | * | |
670 | * In both cases, {@code fallback(CharsetUtil.NAME_GSM8)} is used. | |
671 | * | |
672 | * <p> | |
673 | * If this method is called several times, only the last value is used. | |
674 | * | |
675 | * <p> | |
676 | * If {@code null} value is set, it is like not setting a value at all. The | |
677 | * property/default value configuration is applied. | |
678 | * | |
679 | * @param charsetName | |
680 | * the name of the charset to use (see {@link CharsetUtil}) | |
681 | * @return this instance for fluent chaining | |
682 | */ | |
683 | public EncoderBuilder fallback(String charsetName) { | |
684 |
1
1. fallback : removed call to fr/sii/ogham/core/builder/configuration/ConfigurationValueBuilderHelper::setValue → NO_COVERAGE |
fallbackCharsetNameValueBuilder.setValue(charsetName); |
685 |
1
1. fallback : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::fallback → NO_COVERAGE |
return this; |
686 | } | |
687 | ||
688 | /** | |
689 | * Set which Cloudhopper {@link Charset} should be used if nothing else is | |
690 | * configured. | |
691 | * | |
692 | * <p> | |
693 | * This method is mainly used by {@link Configurer}s to register some | |
694 | * property keys and/or a default value. The aim is to let developer be able | |
695 | * to externalize its configuration (using system properties, configuration | |
696 | * file or anything else). If the developer doesn't configure any value for | |
697 | * the registered properties, the default value is used (if set). | |
698 | * | |
699 | * <pre> | |
700 | * .fallback() | |
701 | * .properties("${custom.property.high-priority}", "${custom.property.low-priority}") | |
702 | * .defaultValue(CharsetUtil.NAME_GSM) | |
703 | * </pre> | |
704 | * | |
705 | * <p> | |
706 | * Non-null value set using {@link #fallback(String)} takes precedence over | |
707 | * property values and default value. | |
708 | * | |
709 | * <pre> | |
710 | * .fallback(CharsetUtil.NAME_GSM8) | |
711 | * .fallback() | |
712 | * .properties("${custom.property.high-priority}", "${custom.property.low-priority}") | |
713 | * .defaultValue(CharsetUtil.NAME_GSM) | |
714 | * </pre> | |
715 | * | |
716 | * The value {@code CharsetUtil.NAME_GSM8} is used regardless of the value | |
717 | * of the properties and default value. | |
718 | * | |
719 | * <p> | |
720 | * See {@link ConfigurationValueBuilder} for more information. | |
721 | * | |
722 | * | |
723 | * @return the builder to configure property keys/default value | |
724 | */ | |
725 | public ConfigurationValueBuilder<EncoderBuilder, String> fallback() { | |
726 |
5
1. fallback : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::fallback → KILLED 2. fallback : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::fallback → KILLED 3. fallback : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::fallback → KILLED 4. fallback : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::fallback → KILLED 5. fallback : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::fallback → KILLED |
return fallbackCharsetNameValueBuilder; |
727 | } | |
728 | ||
729 | @Override | |
730 | public Encoder build() { | |
731 |
2
1. build : negated conditional → SURVIVED 2. build : negated conditional → KILLED |
if (autoGuessEnabled()) { |
732 |
2
1. build : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::build → SURVIVED 2. build : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::build → KILLED |
return buildAutoGuessEncoder(); |
733 | } | |
734 |
1
1. build : negated conditional → NO_COVERAGE |
if (customEncodersRegistered()) { |
735 |
1
1. build : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::build → NO_COVERAGE |
return buildContext.register(new GuessEncodingEncoder(customEncoders.getOrdered())); |
736 | } | |
737 | String fallbackCharsetName = fallbackCharsetNameValueBuilder.getValue(); | |
738 |
2
1. build : negated conditional → NO_COVERAGE 2. build : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::build → NO_COVERAGE |
return buildFixedEncoder(fallbackCharsetName == null ? NAME_GSM : fallbackCharsetName); |
739 | } | |
740 | ||
741 | protected boolean autoGuessEnabled() { | |
742 |
6
1. autoGuessEnabled : replaced boolean return with true for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::autoGuessEnabled → SURVIVED 2. autoGuessEnabled : replaced boolean return with false for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::autoGuessEnabled → KILLED 3. autoGuessEnabled : replaced boolean return with false for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::autoGuessEnabled → KILLED 4. autoGuessEnabled : replaced boolean return with false for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::autoGuessEnabled → KILLED 5. autoGuessEnabled : replaced boolean return with false for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::autoGuessEnabled → KILLED 6. autoGuessEnabled : replaced boolean return with false for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::autoGuessEnabled → KILLED |
return autoGuessValueBuilder.getValue(false); |
743 | } | |
744 | ||
745 | private boolean customEncodersRegistered() { | |
746 |
2
1. customEncodersRegistered : replaced boolean return with true for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::customEncodersRegistered → NO_COVERAGE 2. customEncodersRegistered : negated conditional → NO_COVERAGE |
return !customEncoders.isEmpty(); |
747 | } | |
748 | ||
749 | private Encoder buildAutoGuessEncoder() { | |
750 | PriorizedList<Encoder> registry = new PriorizedList<>(); | |
751 |
2
1. buildAutoGuessEncoder : removed call to fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::registerStandardEncoder → SURVIVED 2. buildAutoGuessEncoder : removed call to fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::registerStandardEncoder → KILLED |
registerStandardEncoder(gsm7PackedValueBuilder, registry); |
752 |
2
1. buildAutoGuessEncoder : removed call to fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::registerStandardEncoder → SURVIVED 2. buildAutoGuessEncoder : removed call to fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::registerStandardEncoder → KILLED |
registerStandardEncoder(gsm8ValueBuilder, registry); |
753 |
1
1. buildAutoGuessEncoder : removed call to fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::registerStandardEncoder → SURVIVED |
registerStandardEncoder(latin1ValueBuilder, registry); |
754 |
3
1. buildAutoGuessEncoder : removed call to fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::registerStandardEncoder → SURVIVED 2. buildAutoGuessEncoder : removed call to fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::registerStandardEncoder → KILLED 3. buildAutoGuessEncoder : removed call to fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::registerStandardEncoder → KILLED |
registerStandardEncoder(ucs2ValueBuilder, registry); |
755 | registry.register(customEncoders); | |
756 |
2
1. buildAutoGuessEncoder : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::buildAutoGuessEncoder → SURVIVED 2. buildAutoGuessEncoder : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::buildAutoGuessEncoder → KILLED |
return buildContext.register(new GuessEncodingEncoder(registry.getOrdered())); |
757 | } | |
758 | ||
759 | private Encoder buildFixedEncoder(String charsetName) { | |
760 |
1
1. buildFixedEncoder : replaced return value with null for fr/sii/ogham/sms/builder/cloudhopper/EncoderBuilder::buildFixedEncoder → NO_COVERAGE |
return buildContext.register(new CloudhopperCharsetSupportingEncoder(NamedCharset.from(charsetName))); |
761 | } | |
762 | ||
763 | private void registerStandardEncoder(StandardEncodingHelper helper, PriorizedList<Encoder> registry) { | |
764 | Integer priority = helper.getValue(); | |
765 |
5
1. registerStandardEncoder : changed conditional boundary → SURVIVED 2. registerStandardEncoder : negated conditional → SURVIVED 3. registerStandardEncoder : negated conditional → SURVIVED 4. registerStandardEncoder : negated conditional → KILLED 5. registerStandardEncoder : negated conditional → KILLED |
if (priority == null || priority <= 0) { |
766 | return; | |
767 | } | |
768 | registry.register(buildContext.register(new CloudhopperCharsetSupportingEncoder(helper.getCharset())), priority); | |
769 | } | |
770 | } | |
Mutations | ||
112 |
1.1 2.2 3.3 4.4 5.5 |
|
113 |
1.1 2.2 3.3 4.4 5.5 |
|
114 |
1.1 2.2 3.3 4.4 5.5 |
|
115 |
1.1 2.2 3.3 4.4 5.5 |
|
165 |
1.1 2.2 |
|
166 |
1.1 2.2 |
|
214 |
1.1 2.2 3.3 4.4 5.5 |
|
259 |
1.1 2.2 |
|
260 |
1.1 2.2 |
|
306 |
1.1 2.2 3.3 4.4 5.5 |
|
349 |
1.1 2.2 |
|
350 |
1.1 2.2 |
|
394 |
1.1 2.2 3.3 4.4 5.5 |
|
436 |
1.1 |
|
437 |
1.1 |
|
480 |
1.1 2.2 3.3 4.4 5.5 |
|
517 |
1.1 |
|
579 |
1.1 2.2 |
|
580 |
1.1 2.2 |
|
645 |
1.1 2.2 3.3 4.4 5.5 |
|
684 |
1.1 |
|
685 |
1.1 |
|
726 |
1.1 2.2 3.3 4.4 5.5 |
|
731 |
1.1 2.2 |
|
732 |
1.1 2.2 |
|
734 |
1.1 |
|
735 |
1.1 |
|
738 |
1.1 2.2 |
|
742 |
1.1 2.2 3.3 4.4 5.5 6.6 |
|
746 |
1.1 2.2 |
|
751 |
1.1 2.2 |
|
752 |
1.1 2.2 |
|
753 |
1.1 |
|
754 |
1.1 2.2 3.3 |
|
756 |
1.1 2.2 |
|
760 |
1.1 |
|
765 |
1.1 2.2 3.3 4.4 5.5 |