if (clazz.equals(play.db.Model.class)) {
return (ModelMapper<M>) new UniversalModelMapper();
}
if (!MappingUtil.isSearchable(clazz)) {
throw new MappingException("Class \"" + clazz.getCanonicalName() + "\" must be annotated with @ElasticSearchable");
}
if (play.db.Model.class.isAssignableFrom(clazz)) {
return (ModelMapper<M>) new PlayModelMapper<play.db.Model>(this,
(Class<play.db.Model>) clazz);
} else {
throw new MappingException(
"No mapper available for non-play.db.Model models at this time");
}
}