Enum Class PhoneNumberUtil.Leniency

java.lang.Object
java.lang.Enum<PhoneNumberUtil.Leniency>
com.google.i18n.phonenumbers.PhoneNumberUtil.Leniency
All Implemented Interfaces:
Serializable, Comparable<PhoneNumberUtil.Leniency>, Constable
Enclosing class:
PhoneNumberUtil

public static enum PhoneNumberUtil.Leniency extends Enum<PhoneNumberUtil.Leniency>
Leniency when finding potential phone numbers in text segments. The levels here are ordered in increasing strictness.
  • Enum Constant Details

    • POSSIBLE

      public static final PhoneNumberUtil.Leniency POSSIBLE
      Phone numbers accepted are possible, but not necessarily valid.
    • VALID

      public static final PhoneNumberUtil.Leniency VALID
      Phone numbers accepted are possible and valid. Numbers written in national format must have their national-prefix present if it is usually written for a number of this type.
    • STRICT_GROUPING

      public static final PhoneNumberUtil.Leniency STRICT_GROUPING
      Phone numbers accepted are valid and are grouped in a possible way for this locale. For example, a US number written as "65 02 53 00 00" and "650253 0000" are not accepted at this leniency level, whereas "650 253 0000", "650 2530000" or "6502530000" are. Numbers with more than one '/' symbol in the national significant number are also dropped at this level.

      Warning: This level might result in lower coverage especially for regions outside of country code "+1". If you are not sure about which level to use, email the discussion group [email protected].

    • EXACT_GROUPING

      public static final PhoneNumberUtil.Leniency EXACT_GROUPING
      Phone numbers accepted are valid and are grouped in the same way that we would have formatted it, or as a single block. For example, a US number written as "650 2530000" is not accepted at this leniency level, whereas "650 253 0000" or "6502530000" are. Numbers with more than one '/' symbol are also dropped at this level.

      Warning: This level might result in lower coverage especially for regions outside of country code "+1". If you are not sure about which level to use, email the discussion group [email protected].

  • Method Details

    • values

      public static PhoneNumberUtil.Leniency[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static PhoneNumberUtil.Leniency valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null