| 1 | package fr.sii.ogham.sms.message.addressing.translator; | |
| 2 | ||
| 3 | import java.util.regex.Pattern; | |
| 4 | ||
| 5 | import fr.sii.ogham.sms.message.PhoneNumber; | |
| 6 | import fr.sii.ogham.sms.message.addressing.NumberingPlanIndicator; | |
| 7 | import fr.sii.ogham.sms.message.addressing.TypeOfNumber; | |
| 8 | ||
| 9 | /** | |
| 10 | * | |
| 11 | * If the sender address is alphanumeric (contains both letters and numbers) or | |
| 12 | * non-numeric, TON is set to 5 and NPI to 0. | |
| 13 | * | |
| 14 | * @author cdejonghe | |
| 15 | * | |
| 16 | */ | |
| 17 | public class AlphanumericCodeNumberFormatHandler extends AbstractFixedPhoneNumberHandler { | |
| 18 | ||
| 19 | private static final Pattern NUMERIC_ONLY_PATTERN = Pattern.compile("(\\+)?[0-9]+"); | |
| 20 | ||
| 21 | public AlphanumericCodeNumberFormatHandler() { | |
| 22 | super(TypeOfNumber.ALPHANUMERIC, NumberingPlanIndicator.UNKNOWN); | |
| 23 | } | |
| 24 | ||
| 25 | @Override | |
| 26 | public boolean supports(PhoneNumber phoneNumber) { | |
| 27 |
16
1. supports : replaced boolean return with true for fr/sii/ogham/sms/message/addressing/translator/AlphanumericCodeNumberFormatHandler::supports → NO_COVERAGE 2. supports : replaced boolean return with true for fr/sii/ogham/sms/message/addressing/translator/AlphanumericCodeNumberFormatHandler::supports → SURVIVED 3. supports : negated conditional → NO_COVERAGE 4. supports : negated conditional → SURVIVED 5. supports : negated conditional → NO_COVERAGE 6. supports : negated conditional → SURVIVED 7. supports : negated conditional → NO_COVERAGE 8. supports : negated conditional → SURVIVED 9. supports : replaced boolean return with true for fr/sii/ogham/sms/message/addressing/translator/AlphanumericCodeNumberFormatHandler::supports → TIMED_OUT 10. supports : negated conditional → TIMED_OUT 11. supports : negated conditional → TIMED_OUT 12. supports : negated conditional → TIMED_OUT 13. supports : replaced boolean return with true for fr/sii/ogham/sms/message/addressing/translator/AlphanumericCodeNumberFormatHandler::supports → KILLED 14. supports : negated conditional → KILLED 15. supports : negated conditional → KILLED 16. supports : negated conditional → KILLED |
return phoneNumber != null && phoneNumber.getNumber() != null && !NUMERIC_ONLY_PATTERN.matcher(phoneNumber.getNumber()).matches(); |
| 28 | } | |
| 29 | } | |
Mutations | ||
| 27 |
1.1 2.2 3.3 4.4 5.5 6.6 7.7 8.8 9.9 10.10 11.11 12.12 13.13 14.14 15.15 16.16 |