Teki
Rules

Phone

Validate phone numbers in E.164 format.

Use phone() on string fields to require a valid E.164 phone number.

Teki schema = Teki.fromRules(
    string("phone").required().phone()
);

E.164 is the international standard for phone numbers: a + sign followed by the country code (1–3 digits) and the subscriber number, up to 15 digits total. Examples: +491511234567, +12025550100.

Local formats such as 01511234567 or (555) 123-4567 are rejected — E.164 is the only unambiguous format for API use.

Available on

  • string(...)

Annotation equivalent

import dev.ditsche.teki.annotation.Phone;

public class ContactRequest {
    @Required
    @Phone
    private String phone;
}

On this page