コード例 #1
0
 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;
 }
コード例 #2
0
 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;
 }