使用Java8优化下面代码public ListInteger findIdentitiesfinal String empCode final ListInteger roles = ListsnewArrayList; if activityAppraiseeServiceexistByEmpCodeempCode rolesaddUser
public List
if (activityAppraiseeService.existByEmpCode(empCode)) {
roles.add(UserTypeEnum.APPRAISEE.getValue());
}
if (activityExaminerService.existByEmpCode(empCode)) {
roles.add(UserTypeEnum.EXAMINER.getValue());
}
return roles;
}
原文地址: http://www.cveoy.top/t/topic/hCqb 著作权归作者所有。请勿转载和采集!