的isPresent代码,这是条件语句,它可以使用ifPresent来代替它?:如何优化的Java
if (mo.findParameterValueByPath("primaryCRLDP").isPresent()
&& mo.findParameterValueByPath("secondaryCRLDP").isPresent()
&& mo.findParameterValueByPath("primaryCRLDP").get().equals(mo.findParameterValueByPath("secondaryCRLDP").get())) {
return true;
}
也许这样的代码是为什么给我们任选项的人告诉我们主要用它们作为方法参数的原因之一,而不是返回类型 – GhostCat
@GhostCat看到编辑失败;) –
是的,手机不是这种活动的理想设备... – GhostCat