I was using the JExcel Plugin and i was noticing that i was writing the same code for a different set of objects. (Example shown below).
loanProfileListSheet.addCell(new label(0,rowNum,loanProfileView.getBorrowersList().getBorrowerPartnerId()));
loanProfileListSheet.addCell(new Label(1,rowNum,loanProfileView.getBorrowersList().getFirstName() + " " + loanProfileView.getBorrowersList().getLastName()));
Now I want to know if there is an optimal way to pass a generic object to a utility method which would give me the object i need (so instead of writing somthing like loanProfileView.getBorrowersList().getFirstName(), i would have a util as such
Workbook getWorkBook (List<Object> objectList, List<String> attributes, Hashmap<String, String> attributeHeaders)
This way i would be able to pass any set of objects and get an excel workbook