Enum PhoneNumberUtil.Leniency

    • 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
      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

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static PhoneNumberUtil.Leniency valueOf​(java.lang.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

      • 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 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​(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null