Package com.google.i18n.phonenumbers
Enum PhoneNumberUtil.Leniency
- java.lang.Object
-
- java.lang.Enum<PhoneNumberUtil.Leniency>
-
- com.google.i18n.phonenumbers.PhoneNumberUtil.Leniency
-
- All Implemented Interfaces:
Serializable
,Comparable<PhoneNumberUtil.Leniency>
- 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 Summary
Enum Constants Enum Constant Description 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.POSSIBLE
STRICT_GROUPING
Phone numbers accepted are valid and are grouped in a possible way for this locale.VALID
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PhoneNumberUtil.Leniency
valueOf(String name)
Returns the enum constant of this type with the specified name.static PhoneNumberUtil.Leniency[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
POSSIBLE
public static final PhoneNumberUtil.Leniency POSSIBLE
-
VALID
public static final PhoneNumberUtil.Leniency VALID
-
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 Detail
-
values
public static PhoneNumberUtil.Leniency[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (PhoneNumberUtil.Leniency c : PhoneNumberUtil.Leniency.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static PhoneNumberUtil.Leniency valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-
-