(WebFlux) switchIfEmpty란 무엇입니까?
SwitchIfEmpty란 무엇입니까? switchIfEmpty() 방법은 모노나 플럭스의 값이 출력되지 않는 경우 대신 다른 모노나 플럭스를 출력할 수 있도록 하는 방법입니다. 즉, 모노 또는 플럭스가 비어 있는 경우 다른 모노 또는 플럭스를 반환하여 기본값 또는 대체 값을 제공할 수 있습니다. Mono<User> userMono = userRepository.findById(id) .switchIfEmpty(Mono.error(new UserNotFoundException(“User not found with id: ” + id))); 위의 예를 통해 알아봅시다. … Read more