Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

quarkus-libphonenumber

Quarkus extension for Google's libphonenumber. It provides an injectable PhoneNumberUtil and a @PhoneNumber bean validation constraint. It also bundles the libphonenumber metadata into native images.

Status: pre-release, nothing is published yet. Use 0.1.0-SNAPSHOT from a local mvn install.

Installation

Maven:

<dependency>
    <groupId>org.sitenetsoft</groupId>
    <artifactId>quarkus-libphonenumber</artifactId>
    <version>0.1.0-SNAPSHOT</version>
</dependency>

Gradle:

implementation 'org.sitenetsoft:quarkus-libphonenumber:0.1.0-SNAPSHOT'

Usage

@Inject
PhoneNumberUtil util;

public record Signup(
        @NotNull
        @PhoneNumber(regions = { "CA", "US" }, types = { MOBILE, FIXED_LINE_OR_MOBILE })
        String phone) {
}
  • regions and types empty mean any. null is valid, so pair the constraint with @NotNull.
  • quarkus.libphonenumber.default-region=CA lets users type a number without a +.
  • Canadian and US mobile numbers report FIXED_LINE_OR_MOBILE; list it next to MOBILE.

Documentation

  • Documentation. mvn package -Pdocs builds it into docs/target/generated-docs/.

Building

JAVA_HOME=/path/to/jdk-25 mvn -T 4 verify

The native integration test runs with -Dnative. See Native.

Releasing

Releasing describes the release procedure, its secrets and the local rehearsal.

License

Apache License 2.0

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages