public <T> EntityMeta<T> buildEntityMeta(Class<T> entityClass) {
List<AttachmentMeta> localAttachmentList = new ArrayList<>();
// Look for class level annotations.
CouchEntity couchEntity = ClassUtil.findClassAnnotation(entityClass, CouchEntity.class);
if (couchEntity == null) {
throw CouchException.internalServerError("Class " + entityClass.getName() + " does not have required @CouchEntity annotation.");
}
String entityType;
if (StringUtil.isNotBlank(couchEntity.value())) {
entityType = couchEntity.value();
} else {
entityType = entityClass.getSimpleName();
}
// Look for method level annotations.