private EmployeeBean prepareEmployeeBean(Employee employee) { EmployeeBean bean = new EmployeeBean(); bean.setAddress(employee.getEmpAddress()); bean.setAge(employee.getEmpAge()); bean.setName(employee.getEmpName()); bean.setSalary(employee.getSalary()); bean.setId(employee.getEmpId()); return bean; }
private List<EmployeeBean> prepareListofBean(List<Employee> employees) { List<EmployeeBean> beans = null; if (employees != null && !employees.isEmpty()) { beans = new ArrayList<EmployeeBean>(); EmployeeBean bean = null; for (Employee employee : employees) { bean = new EmployeeBean(); bean.setName(employee.getEmpName()); bean.setId(employee.getEmpId()); bean.setAddress(employee.getEmpAddress()); bean.setSalary(employee.getSalary()); bean.setAge(employee.getEmpAge()); beans.add(bean); } } return beans; }