Phone

@JvmInline
@Serializable
value class Phone(val value: String) : Emptiness

Phone

Example:

val checker = Phone("+989123456789")
checker.isValid() // true

Since

1.4.0

Constructors

Link copied to clipboard
constructor(value: String)

Properties

Link copied to clipboard
val value: String

Functions

Link copied to clipboard
@JvmOverloads
fun format(defaultRegion: String? = null, numberFormat: PhoneNumberFormat = INTERNATIONAL): String?

Formats a phone number in the specified format using default rules.

Link copied to clipboard
open override fun isEmpty(): Boolean

Check phone is empty.

Link copied to clipboard
@JvmOverloads
fun isValid(defaultRegion: String? = null): Boolean

Check phone number is valid.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
@JvmOverloads
fun type(defaultRegion: String? = null): PhoneNumberType?

Gets the type of valid phone number.