public List findIdentities(final String empCode) { final List roles = new ArrayList<>();

if (activityAppraiseeService.existByEmpCode(empCode)) {
    roles.add(UserTypeEnum.APPRAISEE.getValue());
}
if (activityExaminerService.existByEmpCode(empCode)) {
    roles.add(UserTypeEnum.EXAMINER.getValue());
}

return roles;

}

使用Java8优化下面代码public ListInteger findIdentitiesfinal String empCode final ListInteger roles = ListsnewArrayList; if activityAppraiseeServiceexistByEmpCodeempCode rolesaddUser

原文地址: http://www.cveoy.top/t/topic/hCqb 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录