PhoneValidationResult

data class PhoneValidationResult(val formattedNumber: String, val unformattedNumber: String, val formattedWithoutCountryCode: String, val isValid: Boolean)(source)

Represents the result of parsing, formatting, and validating a phone number.

This model provides different standardized representations of the phone number (international, E.164, and national formats) along with its validation state.

Constructors

Link copied to clipboard
constructor(formattedNumber: String, unformattedNumber: String, formattedWithoutCountryCode: String, isValid: Boolean)

Properties

Link copied to clipboard

The phone number in international human-readable format (e.g., "+254 712 345 678").

Link copied to clipboard

The phone number in national format, excluding the country code (e.g., "0712 345 678").

Link copied to clipboard

Whether the phone number is valid for the given country according to libphonenumber rules.

Link copied to clipboard

The phone number in E.164 format, suitable for storage or API communication (e.g., "+254712345678").