Package com.mongodb.internal.validator
Class MappedFieldNameValidator
java.lang.Object
com.mongodb.internal.validator.MappedFieldNameValidator
- All Implemented Interfaces:
FieldNameValidator
@Deprecated(since="2021-05-27")
public class MappedFieldNameValidator
extends Object
implements FieldNameValidator
Deprecated.
Usage of this API is not supported in AEM as a Cloud Service.
A field name validator that serves as a root validator for a map of validators that are applied to child fields. Note that instances of
this class can be nested to achieve a wide variety of validation behaviors.
This class should not be considered a part of the public API.
-
Constructor Summary
ConstructorsConstructorDescriptionMappedFieldNameValidator
(FieldNameValidator defaultValidator, Map<String, FieldNameValidator> fieldNameToValidatorMap) Deprecated.The default validator will be use to validate all fields whose names are not contained int the fieldNameToValidator map. -
Method Summary
Modifier and TypeMethodDescriptiongetValidatorForField
(String fieldName) Deprecated.Gets a new validator to use for the value of the field with the given name.boolean
Deprecated.Returns true if the field name is valid, false otherwise.
-
Constructor Details
-
MappedFieldNameValidator
public MappedFieldNameValidator(FieldNameValidator defaultValidator, Map<String, FieldNameValidator> fieldNameToValidatorMap) Deprecated.The default validator will be use to validate all fields whose names are not contained int the fieldNameToValidator map. The map is used to apply different validators to fields with specific names.- Parameters:
defaultValidator
- the validator to use for any fields not matching any field name in the mapfieldNameToValidatorMap
- a map from field name to FieldNameValidator
-
-
Method Details
-
validate
Deprecated.Description copied from interface:FieldNameValidator
Returns true if the field name is valid, false otherwise.- Specified by:
validate
in interfaceFieldNameValidator
- Parameters:
fieldName
- the field name- Returns:
- true if the field name is valid, false otherwise
-
getValidatorForField
Deprecated.Description copied from interface:FieldNameValidator
Gets a new validator to use for the value of the field with the given name.- Specified by:
getValidatorForField
in interfaceFieldNameValidator
- Parameters:
fieldName
- the field name- Returns:
- a non-null validator
-