Local Phone Number
Overview
This library supports a requirement which needed to be able to filter out telephone numbers based on whether they were local to a given region. E.g. when executing in a UK/GB based scenario, a list of phone numbers needed to be filtered to only include numbers which were valid for GB regions including GB itself (United Kingdom), IM (Isle of man), JE (Jersey) and GG (Guernsey).
Under the covers the Google phone number library does the majority of the work. This library just provides the ability to be able to specify region configs to aid deciding whether a number is local to a region or not.
It also defines a LocalPhoneNumber type which gives some other useful bits of functionality that it also uses the Google phone number library for, e.g. formatting the provided raw phone number into a standardised format, which can be configured, and determining whether a given number is a mobile number or not, again this can be configured, e.g. for the US where in some scenarios the google library will return FIXED_LINE_OR_MOBILE where a number can't be distinctly determined as a mobile, in this case the default config will treat these a mobile numbers, but this can be modified base on requirements.
Useful Commands
// formats code, builds code, runs tests
./gradlew clean spotlessApply build
// check that dependencies are up to date
./gradlew dependencyUpdates