【发布时间】:2021-06-11 10:03:49
【问题描述】:
比较Mono<Integer> a和Mono<Integer> b中的值,如果Mono<Integer> a中的值更大,我想抛出一个错误。
Mono<Integer> a = getA();
Mono<integer> b = getB();
if(a > b) {
throw new RuntimeException();
}
【问题讨论】:
-
你的比较依据是什么? 示例:我可以通过循环遍历每个字符串的字符来比较两个字符串,逐一比较,如果有不匹配,比较两个不匹配的字符。你能用
Mono<Integer>描述一个满足你特定要求的类似过程吗? -
@RobertHarvey 我只是想比较
Mono中Integer值的大小 -
你指的是这个吗? codingame.com/playgrounds/929/…
-
@RobertHarvey 看起来不一样,但我用下面的答案解决了它。感谢您让我知道一个好网站。
标签: java spring-webflux reactor