1、Integerif(Optional.ofNullable(order.getLevelId()).orElse(0)!=0){} //orElse(0)为重设的默认值2、Stringif (!Objects.equals(order.getCouponId(),null)){}