local-phone-number

Library to determine if phone number is local to default region

License

License

GroupId

GroupId

com.github.michaelruocco
ArtifactId

ArtifactId

local-phone-number
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

local-phone-number
Library to determine if phone number is local to default region
Project URL

Project URL

https://github.com/michaelruocco/local-phone-number
Source Code Management

Source Code Management

https://github.com/michaelruocco/local-phone-number

Download local-phone-number

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.michaelruocco/local-phone-number/ -->
<dependency>
    <groupId>com.github.michaelruocco</groupId>
    <artifactId>local-phone-number</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.michaelruocco/local-phone-number/
implementation 'com.github.michaelruocco:local-phone-number:1.0.1'
// https://jarcasting.com/artifacts/com.github.michaelruocco/local-phone-number/
implementation ("com.github.michaelruocco:local-phone-number:1.0.1")
'com.github.michaelruocco:local-phone-number:jar:1.0.1'
<dependency org="com.github.michaelruocco" name="local-phone-number" rev="1.0.1">
  <artifact name="local-phone-number" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.michaelruocco', module='local-phone-number', version='1.0.1')
)
libraryDependencies += "com.github.michaelruocco" % "local-phone-number" % "1.0.1"
[com.github.michaelruocco/local-phone-number "1.0.1"]

Dependencies

compile (1)

Group / Artifact Type Version
com.neovisionaries : nv-i18n jar 1.28

runtime (2)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.30
com.googlecode.libphonenumber : libphonenumber jar 8.12.20

Project Modules

There are no modules declared in this project.

Local Phone Number

Build Status codecov Codacy Badge BCH compliance Quality Gate Status Technical Debt Coverage Lines of Code Maven Central License: MIT

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

Versions

Version
1.0.1
1.0.0
0.1.1
0.1.0