org.mongodb.morphia.query.validation.ValueClassValidator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of morphia Show documentation
Show all versions of morphia Show documentation
Java Object Document Mapper for MongoDB
The newest version!
package org.mongodb.morphia.query.validation;
/**
* Checks that the given value is of the required type.
*/
final class ValueClassValidator implements Validator {
private ValueClassValidator() {
}
/**
* @param value a non-null value
* @param requiredClass a non-null type to validate against
*/
static boolean valueIsClassOrSubclassOf(final Object value,
final Class requiredClass) {
return (requiredClass.isAssignableFrom(value.getClass()));
}
}