Package dev.morphia.query.validation
Class KeyValueTypeValidator
- java.lang.Object
-
- dev.morphia.query.validation.ValueValidator
-
- dev.morphia.query.validation.KeyValueTypeValidator
-
- All Implemented Interfaces:
Validator
public final class KeyValueTypeValidator extends ValueValidator
This makes sure that the field type and the Key type match.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static KeyValueTypeValidator
getInstance()
Get the instance.protected java.lang.Class<?>
getRequiredValueType()
Used byapply
to figure out whether to apply the validation or simply return.protected void
validate(java.lang.Class<?> type, java.lang.Object value, java.util.List<ValidationFailure> validationFailures)
-
Methods inherited from class dev.morphia.query.validation.ValueValidator
apply
-
-
-
-
Method Detail
-
getInstance
public static KeyValueTypeValidator getInstance()
Get the instance.- Returns:
- the Singleton instance of this validator
-
getRequiredValueType
protected java.lang.Class<?> getRequiredValueType()
Description copied from class:ValueValidator
Used byapply
to figure out whether to apply the validation or simply return.- Specified by:
getRequiredValueType
in classValueValidator
- Returns:
- the class the value should be in order to go ahead and perform validation
-
validate
protected void validate(java.lang.Class<?> type, java.lang.Object value, java.util.List<ValidationFailure> validationFailures)
- Specified by:
validate
in classValueValidator
-
-