com.google.i18n.phonenumbers
Enum PhoneNumberUtil.Leniency

java.lang.Object
  extended by java.lang.Enum<PhoneNumberUtil.Leniency>
      extended by 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
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
          Phone numbers accepted are possible, but not necessarily valid.
STRICT_GROUPING
          Phone numbers accepted are valid and are grouped in a possible way for this locale.
VALID
          Phone numbers accepted are possible and valid.
 
Method Summary
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.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

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 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 name
NullPointerException - if the argument is null


Copyright © 2012 Google. All Rights Reserved.