阅读背景:

减少代码行和使用可选的最佳方法

来源:互联网 
    optional(customerVO.getGender()).ifPresent(customer -> {
        if (!customer.equals("-1")) {
            mstCustomer.setGender(customer);
        }
    });

    public static Optional<String> optional(String value) {
        return StringUtils.isNotBlank(value) ? Optional.of(value) : Optional.empty();
    }
    optional(customerVO.getGender()).ifPresent(



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: