language/java

자주 사용되는 Stream

datajoy 2020. 8. 7. 01:26
this.empList = this.empList
				.stream()
				.filter(a -> Emp.CONFIRM.equals(a.getStatCd()))
				.collect(Collectors.toList());
                

his.empList = this.empList
					.stream()
					.sorted((a,b) -> a.getOrderNum().compareTo(b.getOrderNum()))
					.collect(Collectors.toList());
                    
boolean isExistData = empList
						.stream()
						.anyMatch(a -> a.getEmpId().startsWith(params.getEmpId()));