Package com.unboundid.ldap.matchingrules
Enum TelephoneNumberValidationPolicy
- java.lang.Object
-
- java.lang.Enum<TelephoneNumberValidationPolicy>
-
- com.unboundid.ldap.matchingrules.TelephoneNumberValidationPolicy
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<TelephoneNumberValidationPolicy>
@ThreadSafety(level=COMPLETELY_THREADSAFE) public enum TelephoneNumberValidationPolicy extends java.lang.Enum<TelephoneNumberValidationPolicy>
This enum defines the policy that theTelephoneNumberMatchingRule
should use when validating values in accordance with the syntax. Regardless of the validation policy, the normalized representation of a value will be the provided value, converted to lowercase, with only spaces and hyphens removed.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ALLOW_NON_EMPTY_PRINTABLE_STRING
A policy that indicates that any non-empty printable string will be accepted.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.ENFORCE_STRICT_X520_COMPLIANCE
A policy that indicates that only values that strictly adhere to the X.520 specification will be accepted.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
validateValue(ASN1OctetString value, boolean isSubstring)
Validates the provided value to ensure that it satisfies this validation policy.static TelephoneNumberValidationPolicy
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static TelephoneNumberValidationPolicy[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
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 namejava.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 benull
.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.
-
-