//空的判断
String num = null; Optional.ofNullable(num).orElseThrow(() -> new RuntimeException("num为空"));