일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- 그리디
- cleancode
- 클린코드
- Elasticsearch
- 백준
- database
- 읽기쉬운코드
- Spring
- JPA
- 데이터베이스
- mongoDB
- 코딩
- 알고리즘
- 엘라스틱서치
- 개발
- Java
- 코딩테스트
- framework
- 개발자
- 스프링
- 자바
- 그리디알고리즘
- ES
- Baekjoon
- spring boot
- 애자일기법
- 코드
- API
- 애자일프로그래밍
- 프레임워크
- Today
- Total
목록Optional (2)
튼튼발자 개발 성장기🏋️

1. Stream을 활용한 최대값, 최소값, 개수 추출하기 /** * Returns the minimum element of this stream according to the provided * {@code Comparator}. This is a special case of a * reduction. * * This is a terminal operation. * * @param comparator a non-interfering, * stateless * {@code Comparator} to compare elements of this stream * @return an {@code Optional} describing the minimum element of this stream, * or an..
Stream의 종결처리 과정을 이해하기 위해 Optional을 필수로 알아야하는 도구이다. Optional이 어떤 문제를 해결해주는걸까? 우리가 가장 많은 고민을 했던 NPE(NullPointException)가 Oprional의 사용 목적의 핵심이다. NPE는 Runtime error이기 때문에 실행 전까지 발견하기 쉽지가 않다. 현업에서도 종종 NPE가 발생해서 빠른 대응이 필요할 때도 있다. @Getter @Builder @ToString class User { private int id; private String name; private String email; private boolean isVerified; } public class Exercise { public static void ma..