1
我应该使用哪种RxJava操作来将此混乱重写为更简单的版本?用rxjava简化多个if'
.map(content -> {
if (content.getPost() != null) {
return content.getPost();
} else if (content.getAction() != null) {
return content.getAction().getPost();
} else {
return null;
}
})
喜欢的东西
.map(Content::getPost)
.map(Content::getAction::getPost)
.combine(..)
这可能吗?
不能简化与RxJava;它看起来很好,因为顺便说一句。 – akarnokd
谢谢!虽然,总有办法完美线条(: – aleien