Java Stream
18개 함수
streamcollection.stream()컬렉션에서 스트림을 생성합니다.
filterstream.filter(predicate)조건을 만족하는 요소만 남깁니다.
mapstream.map(mapper)각 요소를 변환합니다.
flatMapstream.flatMap(mapper)중첩 스트림을 평탄화합니다.
collectstream.collect(collector)스트림 요소를 컬렉션 등으로 수집합니다.
forEachstream.forEach(consumer)각 요소에 동작을 수행합니다.
reducestream.reduce(identity, accumulator)요소를 누적하여 단일 결과를 만듭니다.
sortedstream.sorted(comparator?)요소를 정렬합니다.
distinctstream.distinct()중복 요소를 제거합니다.
limitstream.limit(maxSize)최대 n개의 요소로 제한합니다.
skipstream.skip(n)앞의 n개 요소를 건너뜁니다.
countstream.count()스트림 요소 수를 반환합니다.
anyMatchstream.anyMatch(predicate)조건을 만족하는 요소가 하나라도 있는지 확인합니다.
allMatchstream.allMatch(predicate)모든 요소가 조건을 만족하는지 확인합니다.
findFirststream.findFirst()첫 번째 요소를 Optional로 반환합니다.
Collectors.toListCollectors.toList()스트림을 List로 수집합니다.
Collectors.joiningCollectors.joining(delimiter, prefix?, suffix?)문자열 요소를 연결합니다.
Collectors.groupingByCollectors.groupingBy(classifier)키 기준으로 그룹화하여 Map을 반환합니다.
