Class LibPhoneNumberNormalizer
java.lang.Object
com.irurueta.authserver.authorization.infrastructure.sms.LibPhoneNumberNormalizer
- All Implemented Interfaces:
PhoneNormalizer
PhoneNormalizer backed by Google libphonenumber: accepts only valid numbers and never throws.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.google.i18n.phonenumbers.PhoneNumberUtilThe libphonenumber entry point. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionNormalizes a number.
-
Field Details
-
util
private final com.google.i18n.phonenumbers.PhoneNumberUtil utilThe libphonenumber entry point.
-
-
Constructor Details
-
LibPhoneNumberNormalizer
public LibPhoneNumberNormalizer()
-
-
Method Details
-
normalize
Description copied from interface:PhoneNormalizerNormalizes a number.- Specified by:
normalizein interfacePhoneNormalizer- Parameters:
input- what the user typed, possibly with spaces or punctuation.defaultRegion- ISO 3166-1 alpha-2 code of the region assumed when the input has no country prefix.- Returns:
- the number, or empty when the input is not a valid phone number.
-