Enum TelephoneNumberValidationPolicy

    • Enum Constant Detail

      • ALLOW_NON_EMPTY_PRINTABLE_STRING

        public static final TelephoneNumberValidationPolicy ALLOW_NON_EMPTY_PRINTABLE_STRING
        A policy that indicates that any non-empty printable string will be accepted. Neither empty strings nor strings that contain characters from outside the set of printable characters will be accepted.
      • ALLOW_NON_EMPTY_PRINTABLE_STRING_WITH_AT_LEAST_ONE_DIGIT

        public static final TelephoneNumberValidationPolicy ALLOW_NON_EMPTY_PRINTABLE_STRING_WITH_AT_LEAST_ONE_DIGIT
        A policy that indicates that any non-empty printable string will be accepted, as long as it contains at least one digit. Neither empty strings, strings nor strings that contain characters from outside the set of printable characters, nor strings without any digits will be accepted.
      • ENFORCE_STRICT_X520_COMPLIANCE

        public static final TelephoneNumberValidationPolicy ENFORCE_STRICT_X520_COMPLIANCE
        A policy that indicates that only values that strictly adhere to the X.520 specification will be accepted. Only values that start with a plus sign, contain at least one digit, and contain only digits, spaces, and hyphens will be accepted.
    • Method Detail

      • values

        public static TelephoneNumberValidationPolicy[] 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 (TelephoneNumberValidationPolicy c : TelephoneNumberValidationPolicy.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static TelephoneNumberValidationPolicy 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
      • validateValue

        public void validateValue​(@NotNull
                                  ASN1OctetString value,
                                  boolean isSubstring)
                           throws LDAPException
        Validates the provided value to ensure that it satisfies this validation policy.
        Parameters:
        value - The value to be validated. It must not be null.
        isSubstring - Indicates whether the provided value represents a substring rather than a complete value.
        Throws:
        LDAPException - If the provided value is not acceptable as per the constraints of this policy.