Skip to content

Instantly share code, notes, and snippets.

@drewbrokke
Created January 11, 2018 22:52
Show Gist options
  • Save drewbrokke/c39d8160b947567f117f1fbc8245cd90 to your computer and use it in GitHub Desktop.
Save drewbrokke/c39d8160b947567f117f1fbc8245cd90 to your computer and use it in GitHub Desktop.
Entity Validator
protected <T extends UADEntity> T validate(
UADEntity uadEntity, Class<T> clazz) throws UADEntityException {
if (!(clazz.isAssignableFrom(uadEntity.getClass()))) {
throw new UADEntityException();
}
return (T)uadEntity;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment