use of org.onebusaway.api.model.transit.ListWithReferencesBean in project onebusaway-application-modules by camsys.
the class CustomCsvHandler method getEntityType.
/**
**
*
***
*/
private Class<?> getEntityType(Object obj) {
if (obj instanceof ResponseBean) {
ResponseBean response = (ResponseBean) obj;
if (response.getData() == null)
return response.getClass();
return getEntityType(response.getData());
} else if (obj instanceof EntryWithReferencesBean) {
EntryWithReferencesBean<?> entry = (EntryWithReferencesBean<?>) obj;
return entry.getEntry().getClass();
} else if (obj instanceof ListWithReferencesBean) {
ListWithReferencesBean<?> list = (ListWithReferencesBean<?>) obj;
List<?> values = list.getList();
if (values.isEmpty())
return Object.class;
return values.get(0).getClass();
}
return obj.getClass();
}
Aggregations